home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1992-10-16 | 26.9 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Thu Oct 15 20:17:18 1992, modified Thu Oct 15 20:17:18 1992, creator 'MPS ', type ASCII, 26467 bytes "SimpleInPrint.c" , at 0x67e3 872 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 53 69 6d 70 6c 65 | 49 6e 50 72 69 6e 74 2e |..Simple|InPrint.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 67 63 00 | 00 03 68 a7 03 ba 8e a7 |.....gc.|..h.....|
|00000060| 03 ba 8e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 24 d9 00 00 |........|....$...|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 0d 53 69 6d 70 6c 65 49 | 6e 4d 6f 76 69 65 73 0d |.SimpleI|nMovies.|
|000000e0| 0d 53 61 6d 70 6c 65 20 | 70 72 6f 67 72 61 6d 73 |.Sample |programs|
|000000f0| 20 64 65 6d 6f 6e 73 74 | 72 61 74 69 6e 67 20 68 | demonst|rating h|
|00000100| 6f 77 20 74 6f 20 6f 70 | 65 6e 20 61 6e 64 20 64 |ow to op|en and d|
|00000110| 69 73 70 6c 61 79 0d 51 | 75 69 63 6b 54 69 6d 65 |isplay.Q|uickTime|
|00000120| aa 20 4d 6f 76 69 65 73 | 2e 0d 0d 53 69 6d 70 6c |. Movies|...Simpl|
|00000130| 65 49 6e 50 72 69 6e 74 | 2e 63 20 66 69 6c 65 20 |eInPrint|.c file |
|00000140| 63 6f 6e 74 61 69 6e 73 | 20 74 68 65 20 63 6f 64 |contains| the cod|
|00000150| 65 20 70 72 69 6e 74 69 | 6e 67 20 6d 6f 76 69 65 |e printi|ng movie|
|00000160| 20 70 6f 73 74 65 72 73 | 2e 0d 0d 47 75 69 6c 6c | posters|...Guill|
|00000170| 65 72 6d 6f 20 41 2e 20 | 4f 72 74 69 7a 0d 4d 61 |ermo A. |Ortiz.Ma|
|00000180| 63 69 6e 74 6f 73 68 20 | 44 65 76 65 6c 6f 70 65 |cintosh |Develope|
|00000190| 72 20 54 65 63 68 6e 69 | 63 61 6c 20 53 75 70 70 |r Techni|cal Supp|
|000001a0| 6f 72 74 0d 0d 31 32 2f | 30 33 2f 39 31 20 2d 2d |ort..12/|03/91 --|
|000001b0| 20 41 64 64 65 64 20 66 | 69 6c 65 20 61 6e 64 20 | Added f|ile and |
|000001c0| 6d 61 64 65 20 63 68 61 | 6e 67 65 73 20 74 6f 20 |made cha|nges to |
|000001d0| 70 72 69 6e 74 20 6d 6f | 76 69 65 20 70 6f 73 74 |print mo|vie post|
|000001e0| 65 72 73 2e 0d 0d 49 4d | 50 4f 52 54 41 4e 54 20 |ers...IM|PORTANT |
|000001f0| 4e 4f 54 45 3a 0d 54 68 | 69 73 20 63 6f 64 65 20 |NOTE:.Th|is code |
|00000200| 63 6f 6d 65 73 20 73 74 | 72 61 69 67 68 74 20 66 |comes st|raight f|
|00000210| 72 6f 6d 20 74 68 65 20 | 44 65 76 65 6c 6f 70 20 |rom the |Develop |
|00000220| 61 72 74 69 63 6c 65 20 | 28 61 6e 64 20 69 74 73 |article |(and its|
|00000230| 20 63 6f 64 65 29 20 4d | 65 65 74 20 50 72 47 65 | code) M|eet PrGe|
|00000240| 6e 65 72 61 6c 2c 0d 44 | 65 76 65 6c 6f 70 20 23 |neral,.D|evelop #|
|00000250| 33 20 62 79 20 50 65 74 | 65 20 22 4c 75 6b 65 22 |3 by Pet|e "Luke"|
|00000260| 20 41 6c 65 78 61 6e 64 | 65 72 2e 20 41 6c 6c 20 | Alexand|er. All |
|00000270| 74 68 65 20 63 72 65 64 | 69 74 20 67 6f 65 73 20 |the cred|it goes |
|00000280| 74 6f 20 74 68 65 20 73 | 6f 75 72 63 65 2e 20 43 |to the s|ource. C|
|00000290| 68 65 63 6b 20 44 65 76 | 65 6c 6f 70 0d 66 6f 72 |heck Dev|elop.for|
|000002a0| 20 63 6f 6d 70 6c 65 74 | 65 20 63 6f 6d 6d 65 6e | complet|e commen|
|000002b0| 74 73 2e 0d 0d 49 6e 20 | 74 68 65 20 6f 74 68 65 |ts...In |the othe|
|000002c0| 72 20 68 61 6e 64 20 62 | 6c 61 6d 65 20 61 6c 6c |r hand b|lame all|
|000002d0| 20 70 72 6f 62 6c 65 6d | 73 20 69 6e 20 74 68 65 | problem|s in the|
|000002e0| 20 63 68 61 6e 67 65 73 | 20 74 68 61 74 20 77 65 | changes| that we|
|000002f0| 72 65 20 6d 61 64 65 20 | 69 6e 20 6f 72 64 65 72 |re made |in order|
|00000300| 20 74 6f 20 6d 61 6b 65 | 20 0d 69 74 20 64 6f 20 | to make| .it do |
|00000310| 74 68 65 20 74 68 69 6e | 67 73 20 6e 65 65 64 65 |the thin|gs neede|
|00000320| 64 20 69 6e 20 74 68 65 | 20 53 69 6d 70 6c 65 49 |d in the| SimpleI|
|00000330| 6e 4d 6f 76 69 65 73 20 | 73 61 6d 70 6c 65 2e 0d |nMovies |sample..|
|00000340| 0d 0d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |..------|--------|
|00000350| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000360| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000370| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000380| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000390| 2a 2f 0d 0d 23 69 6e 63 | 6c 75 64 65 20 3c 53 69 |*/..#inc|lude <Si|
|000003a0| 6d 70 6c 65 49 6e 4d 6f | 76 69 65 2e 68 3e 0d 0d |mpleInMo|vie.h>..|
|000003b0| 65 78 74 65 72 6e 20 76 | 6f 69 64 09 50 6f 73 69 |extern v|oid.Posi|
|000003c0| 74 69 6f 6e 52 65 63 74 | 49 6e 52 65 63 74 28 52 |tionRect|InRect(R|
|000003d0| 65 63 74 2c 20 52 65 63 | 74 20 2a 2c 20 46 69 78 |ect, Rec|t *, Fix|
|000003e0| 65 64 20 2c 20 46 69 78 | 65 64 29 3b 0d 0d 2f 2f |ed , Fix|ed);..//|
|000003f0| 20 20 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 | The fo|llowing |
|00000400| 65 78 74 65 72 6e 20 67 | 6c 6f 62 61 6c 73 20 61 |extern g|lobals a|
|00000410| 72 65 20 73 65 74 20 75 | 70 20 62 79 20 74 68 65 |re set u|p by the|
|00000420| 20 49 6e 69 74 69 61 6c | 69 7a 65 20 66 75 6e 63 | Initial|ize func|
|00000430| 74 69 6f 6e 20 69 6e 20 | 53 69 6d 70 6c 65 49 6e |tion in |SimpleIn|
|00000440| 4d 6f 76 69 65 73 2e 63 | 0d 0d 54 48 50 72 69 6e |Movies.c|..THPrin|
|00000450| 74 09 09 09 67 50 72 52 | 65 63 48 64 6c 3b 0d 42 |t...gPrR|ecHdl;.B|
|00000460| 6f 6f 6c 65 61 6e 09 09 | 09 67 48 69 67 68 52 65 |oolean..|.gHighRe|
|00000470| 73 6f 6c 75 74 69 6f 6e | 4f 4e 20 3d 20 66 61 6c |solution|ON = fal|
|00000480| 73 65 2c 20 20 0d 09 09 | 09 09 09 09 67 55 73 65 |se, ...|....gUse|
|00000490| 44 72 61 66 74 42 69 74 | 73 20 3d 20 66 61 6c 73 |DraftBit|s = fals|
|000004a0| 65 2c 0d 09 09 09 09 09 | 09 67 43 68 65 63 6b 46 |e,......|.gCheckF|
|000004b0| 6f 72 4c 61 6e 64 73 63 | 61 70 65 20 3d 20 66 61 |orLandsc|ape = fa|
|000004c0| 6c 73 65 2c 0d 09 09 09 | 09 09 09 67 44 72 61 66 |lse,....|...gDraf|
|000004d0| 74 42 69 74 73 48 61 73 | 42 65 65 6e 53 65 74 20 |tBitsHas|BeenSet |
|000004e0| 3d 20 66 61 6c 73 65 2c | 0d 09 09 09 09 09 09 67 |= false,|.......g|
|000004f0| 50 72 47 65 6e 65 72 61 | 6c 4c 69 76 65 73 2c 0d |PrGenera|lLives,.|
|00000500| 09 09 09 09 09 09 67 4c | 61 6e 64 73 63 61 70 65 |......gL|andscape|
|00000510| 4f 70 49 6d 70 6c 2c 0d | 09 09 09 09 09 09 67 44 |OpImpl,.|......gD|
|00000520| 72 61 66 74 42 69 74 73 | 4f 70 49 6d 70 6c 2c 0d |raftBits|OpImpl,.|
|00000530| 09 09 09 09 09 09 67 53 | 65 74 52 73 6c 4f 70 49 |......gS|etRslOpI|
|00000540| 6d 70 6c 3b 0d 0d 73 68 | 6f 72 74 09 09 09 67 4f |mpl;..sh|ort...gO|
|00000550| 72 69 67 69 6e 61 6c 44 | 72 69 76 65 72 56 65 72 |riginalD|riverVer|
|00000560| 73 3b 0d 09 09 09 09 09 | 09 0d 73 68 6f 72 74 20 |s;......|..short |
|00000570| 20 09 09 09 09 09 67 53 | 63 61 6c 65 20 3d 20 31 | .....gS|cale = 1|
|00000580| 2c 0d 09 09 09 09 09 09 | 67 4d 61 78 44 50 49 20 |,.......|gMaxDPI |
|00000590| 3d 20 30 2c 0d 09 09 09 | 09 09 09 67 4f 72 69 67 |= 0,....|...gOrig|
|000005a0| 69 6e 61 6c 69 56 52 65 | 73 2c 0d 09 09 09 09 09 |inaliVRe|s,......|
|000005b0| 09 67 4f 72 69 67 69 6e | 61 6c 69 48 52 65 73 3b |.gOrigin|aliHRes;|
|000005c0| 0d 0d 0d 76 6f 69 64 20 | 6e 6f 50 72 47 65 6e 65 |...void |noPrGene|
|000005d0| 72 61 6c 41 6c 65 72 74 | 20 28 20 76 6f 69 64 20 |ralAlert| ( void |
|000005e0| 29 3b 0d 42 6f 6f 6c 65 | 61 6e 20 74 65 73 74 46 |);.Boole|an testF|
|000005f0| 6f 72 50 72 47 65 6e 65 | 72 61 6c 20 28 20 76 6f |orPrGene|ral ( vo|
|00000600| 69 64 20 29 3b 0d 76 6f | 69 64 20 73 61 76 65 52 |id );.vo|id saveR|
|00000610| 65 73 6f 6c 75 74 69 6f | 6e 20 28 20 76 6f 69 64 |esolutio|n ( void|
|00000620| 20 29 3b 0d 76 6f 69 64 | 20 72 65 73 65 74 53 65 | );.void| resetSe|
|00000630| 74 52 73 6c 20 28 20 76 | 6f 69 64 20 29 3b 0d 69 |tRsl ( v|oid );.i|
|00000640| 6e 74 20 73 65 74 4d 61 | 78 52 65 73 6f 6c 75 74 |nt setMa|xResolut|
|00000650| 69 6f 6e 20 28 20 76 6f | 69 64 20 29 3b 0d 76 6f |ion ( vo|id );.vo|
|00000660| 69 64 20 64 6f 53 65 74 | 52 73 6c 20 28 20 76 6f |id doSet|Rsl ( vo|
|00000670| 69 64 20 29 3b 0d 76 6f | 69 64 20 64 6f 44 72 61 |id );.vo|id doDra|
|00000680| 66 74 42 69 74 73 20 28 | 20 76 6f 69 64 20 29 3b |ftBits (| void );|
|00000690| 0d 76 6f 69 64 20 64 6f | 4e 4f 44 72 61 66 74 42 |.void do|NODraftB|
|000006a0| 69 74 73 20 28 20 76 6f | 69 64 20 29 3b 0d 76 6f |its ( vo|id );.vo|
|000006b0| 69 64 20 64 72 61 77 53 | 74 75 66 66 20 28 47 72 |id drawS|tuff (Gr|
|000006c0| 61 66 50 74 72 09 70 72 | 50 6f 72 74 2c 20 73 68 |afPtr.pr|Port, sh|
|000006d0| 6f 72 74 20 67 53 63 61 | 6c 65 2c 20 50 69 63 48 |ort gSca|le, PicH|
|000006e0| 61 6e 64 6c 65 20 74 6f | 50 72 69 6e 74 29 3b 0d |andle to|Print);.|
|000006f0| 76 6f 69 64 20 63 6f 70 | 79 42 69 74 73 4d 79 47 |void cop|yBitsMyG|
|00000700| 72 61 70 68 20 28 54 50 | 50 72 50 6f 72 74 20 70 |raph (TP|PrPort p|
|00000710| 72 69 6e 74 50 6f 72 74 | 2c 20 50 69 63 48 61 6e |rintPort|, PicHan|
|00000720| 64 6c 65 20 74 6f 50 72 | 69 6e 74 29 3b 0d 76 6f |dle toPr|int);.vo|
|00000730| 69 64 20 63 6f 6d 70 61 | 72 65 50 72 69 6e 74 52 |id compa|rePrintR|
|00000740| 65 63 6f 72 64 73 20 28 | 20 76 6f 69 64 20 29 3b |ecords (| void );|
|00000750| 0d 76 6f 69 64 20 50 72 | 65 73 65 6e 74 53 74 79 |.void Pr|esentSty|
|00000760| 6c 65 44 69 61 6c 6f 67 | 20 28 20 76 6f 69 64 20 |leDialog| ( void |
|00000770| 29 3b 0d 76 6f 69 64 20 | 50 72 69 6e 74 54 68 69 |);.void |PrintThi|
|00000780| 73 28 20 50 69 63 48 61 | 6e 64 6c 65 20 29 3b 0d |s( PicHa|ndle );.|
|00000790| 76 6f 69 64 20 50 72 69 | 6e 74 54 65 72 6d 69 6e |void Pri|ntTermin|
|000007a0| 61 74 65 28 76 6f 69 64 | 29 3b 0d 76 6f 69 64 20 |ate(void|);.void |
|000007b0| 50 72 69 6e 74 49 6e 69 | 74 28 76 6f 69 64 29 3b |PrintIni|t(void);|
|000007c0| 0d 76 6f 69 64 20 41 6c | 65 72 74 55 73 65 72 28 |.void Al|ertUser(|
|000007d0| 29 3b 0d 76 6f 69 64 20 | 50 72 69 6e 74 50 6f 73 |);.void |PrintPos|
|000007e0| 74 65 72 28 76 6f 69 64 | 29 3b 0d 0d 76 6f 69 64 |ter(void|);..void|
|000007f0| 20 50 72 69 6e 74 49 6e | 69 74 28 76 6f 69 64 29 | PrintIn|it(void)|
|00000800| 0d 7b 0d 73 68 6f 72 74 | 20 6d 79 50 72 69 6e 74 |.{.short| myPrint|
|00000810| 45 72 72 3b 0d 0d 2f 2a | 2a 0d 09 20 20 20 20 57 |Err;../*|*.. W|
|00000820| 65 20 77 69 6c 6c 20 61 | 73 73 75 6d 65 20 61 74 |e will a|ssume at|
|00000830| 20 74 68 69 73 20 70 6f | 69 6e 74 20 74 68 61 74 | this po|int that|
|00000840| 20 61 6c 6c 20 6f 66 20 | 50 72 47 65 6e 65 72 61 | all of |PrGenera|
|00000850| 6c 27 73 20 6f 70 63 6f | 64 65 73 20 61 72 65 20 |l's opco|des are |
|00000860| 73 75 70 70 6f 72 74 65 | 64 2e 0d 09 09 57 68 65 |supporte|d....Whe|
|00000870| 6e 20 77 65 20 6d 61 6b | 65 20 61 20 63 61 6c 6c |n we mak|e a call|
|00000880| 20 66 6f 72 20 61 20 70 | 61 72 74 69 63 75 6c 61 | for a p|articula|
|00000890| 72 20 6f 70 63 6f 64 65 | 2c 20 77 65 20 77 69 6c |r opcode|, we wil|
|000008a0| 6c 20 63 68 65 63 6b 20 | 74 6f 20 6d 61 6b 65 20 |l check |to make |
|000008b0| 73 75 72 65 20 74 68 61 | 74 20 0d 09 09 74 68 65 |sure tha|t ...the|
|000008c0| 20 6f 70 63 6f 64 65 20 | 69 73 20 73 75 70 70 6f | opcode |is suppo|
|000008d0| 72 74 65 64 2e 20 20 49 | 66 20 69 74 20 69 73 20 |rted. I|f it is |
|000008e0| 4e 4f 54 2c 20 74 68 65 | 20 61 70 70 72 6f 70 72 |NOT, the| appropr|
|000008f0| 61 69 74 65 20 66 6c 61 | 67 20 77 69 6c 6c 20 62 |aite fla|g will b|
|00000900| 65 20 73 65 74 20 74 6f | 20 66 61 6c 73 65 0d 09 |e set to| false..|
|00000910| 09 61 6e 64 20 74 68 61 | 74 20 6f 70 63 6f 64 65 |.and tha|t opcode|
|00000920| 20 77 69 6c 6c 20 6e 6f | 74 20 62 65 20 63 61 6c | will no|t be cal|
|00000930| 6c 65 64 20 75 6e 74 69 | 6c 20 74 68 65 20 70 72 |led unti|l the pr|
|00000940| 69 6e 74 65 72 20 64 72 | 69 76 65 72 20 69 73 20 |inter dr|iver is |
|00000950| 63 68 61 6e 67 65 64 2e | 0d 09 2a 2a 2f 0d 09 67 |changed.|..**/..g|
|00000960| 4c 61 6e 64 73 63 61 70 | 65 4f 70 49 6d 70 6c 20 |Landscap|eOpImpl |
|00000970| 3d 20 74 72 75 65 3b 0d | 09 67 44 72 61 66 74 42 |= true;.|.gDraftB|
|00000980| 69 74 73 4f 70 49 6d 70 | 6c 20 3d 20 74 72 75 65 |itsOpImp|l = true|
|00000990| 3b 0d 09 67 53 65 74 52 | 73 6c 4f 70 49 6d 70 6c |;..gSetR|slOpImpl|
|000009a0| 20 3d 20 74 72 75 65 3b | 0d 0d 09 2f 2a 2a 0d 09 | = true;|.../**..|
|000009b0| 20 20 20 20 43 72 65 61 | 74 65 20 26 20 69 6e 69 | Crea|te & ini|
|000009c0| 74 69 61 6c 69 7a 65 20 | 74 68 65 20 70 72 69 6e |tialize |the prin|
|000009d0| 74 20 72 65 63 6f 72 64 | 2e 2e 2e 2e 0d 20 20 20 |t record|..... |
|000009e0| 20 20 2a 2a 2f 0d 09 20 | 6d 79 50 72 69 6e 74 45 | **/.. |myPrintE|
|000009f0| 72 72 20 3d 20 30 3b 0d | 09 20 67 50 72 52 65 63 |rr = 0;.|. gPrRec|
|00000a00| 48 64 6c 20 3d 20 28 54 | 48 50 72 69 6e 74 29 20 |Hdl = (T|HPrint) |
|00000a10| 4e 65 77 48 61 6e 64 6c | 65 28 73 69 7a 65 6f 66 |NewHandl|e(sizeof|
|00000a20| 28 54 50 72 69 6e 74 29 | 29 3b 0d 0d 0d 09 20 69 |(TPrint)|);.... i|
|00000a30| 66 20 28 4d 65 6d 45 72 | 72 6f 72 28 29 20 3d 3d |f (MemEr|ror() ==|
|00000a40| 20 6e 6f 45 72 72 20 26 | 26 20 67 50 72 52 65 63 | noErr &|& gPrRec|
|00000a50| 48 64 6c 20 21 3d 20 6e | 69 6c 29 0d 09 20 20 7b |Hdl != n|il).. {|
|00000a60| 0d 09 20 20 20 50 72 4f | 70 65 6e 28 29 3b 20 0d |.. PrO|pen(); .|
|00000a70| 09 20 20 20 20 69 66 20 | 28 50 72 45 72 72 6f 72 |. if |(PrError|
|00000a80| 28 29 20 3d 3d 20 6e 6f | 45 72 72 29 0d 09 09 20 |() == no|Err)... |
|00000a90| 20 7b 0d 09 20 20 20 20 | 20 20 20 50 72 69 6e 74 | {.. | Print|
|00000aa0| 44 65 66 61 75 6c 74 20 | 28 67 50 72 52 65 63 48 |Default |(gPrRecH|
|00000ab0| 64 6c 29 3b 0d 09 0d 09 | 09 20 20 20 2f 2f 20 57 |dl);....|. // W|
|00000ac0| 65 20 6e 65 65 64 20 74 | 6f 20 73 61 76 65 20 74 |e need t|o save t|
|00000ad0| 68 65 20 76 65 72 73 69 | 6f 6e 20 6e 75 6d 62 65 |he versi|on numbe|
|00000ae0| 72 20 6f 66 20 74 68 65 | 20 63 75 72 72 65 6e 74 |r of the| current|
|00000af0| 20 70 72 69 6e 74 65 72 | 20 64 72 69 76 65 72 2e | printer| driver.|
|00000b00| 20 20 54 68 69 73 20 77 | 69 6c 6c 20 65 6e 61 62 | This w|ill enab|
|00000b10| 6c 65 0d 09 09 20 20 20 | 2f 2f 20 75 73 20 74 6f |le... |// us to|
|00000b20| 20 63 6f 6d 70 61 72 65 | 20 74 68 65 20 76 65 72 | compare| the ver|
|00000b30| 73 69 6f 6e 20 6f 66 20 | 74 68 65 20 70 72 69 6e |sion of |the prin|
|00000b40| 74 65 72 20 64 72 69 76 | 65 72 20 77 68 65 6e 20 |ter driv|er when |
|00000b50| 74 68 65 20 75 73 65 72 | 20 63 68 6f 6f 73 65 73 |the user| chooses|
|00000b60| 20 61 20 64 69 66 66 65 | 72 65 6e 74 0d 09 09 20 | a diffe|rent... |
|00000b70| 20 20 2f 2f 20 70 72 69 | 6e 74 65 72 20 64 72 69 | // pri|nter dri|
|00000b80| 76 65 72 20 76 69 61 20 | 74 68 65 20 43 68 6f 6f |ver via |the Choo|
|00000b90| 73 65 72 2e 20 20 54 68 | 69 73 20 69 6d 70 6f 72 |ser. Th|is impor|
|00000ba0| 74 61 6e 74 20 62 65 63 | 61 75 73 65 20 73 6f 6d |tant bec|ause som|
|00000bb0| 65 20 65 61 72 6c 69 65 | 72 20 76 65 72 73 69 6f |e earlie|r versio|
|00000bc0| 6e 73 20 6f 66 20 0d 09 | 09 20 20 20 2f 2f 20 41 |ns of ..|. // A|
|00000bd0| 70 70 6c 65 27 73 20 70 | 72 69 6e 74 65 72 73 20 |pple's p|rinters |
|00000be0| 64 72 69 76 65 72 73 20 | 64 69 64 20 6e 6f 74 20 |drivers |did not |
|00000bf0| 73 75 70 70 6f 72 74 20 | 50 72 47 65 6e 65 72 61 |support |PrGenera|
|00000c00| 6c 2e 20 20 57 68 69 63 | 68 20 69 73 20 74 68 65 |l. Whic|h is the|
|00000c10| 20 63 61 73 65 20 66 6f | 72 20 74 68 65 20 0d 09 | case fo|r the ..|
|00000c20| 09 20 20 20 2f 2f 20 49 | 6d 61 67 65 57 72 69 74 |. // I|mageWrit|
|00000c30| 65 72 20 76 32 2e 35 20 | 61 6e 64 20 4c 61 73 65 |er v2.5 |and Lase|
|00000c40| 72 57 72 69 74 65 72 20 | 76 34 2e 30 20 61 6e 64 |rWriter |v4.0 and|
|00000c50| 20 65 61 72 6c 69 65 72 | 2e 0d 0d 09 09 20 20 20 | earlier|..... |
|00000c60| 67 4f 72 69 67 69 6e 61 | 6c 44 72 69 76 65 72 56 |gOrigina|lDriverV|
|00000c70| 65 72 73 20 3d 20 50 72 | 44 72 76 72 56 65 72 73 |ers = Pr|DrvrVers|
|00000c80| 20 28 29 3b 0d 09 09 20 | 20 20 0d 09 09 20 20 20 | ();... | ... |
|00000c90| 69 66 20 28 50 72 45 72 | 72 6f 72 20 28 29 20 3d |if (PrEr|ror () =|
|00000ca0| 3d 20 6e 6f 45 72 72 29 | 0d 09 20 20 20 20 20 20 |= noErr)|.. |
|00000cb0| 20 20 20 67 50 72 47 65 | 6e 65 72 61 6c 4c 69 76 | gPrGe|neralLiv|
|00000cc0| 65 73 20 3d 20 74 65 73 | 74 46 6f 72 50 72 47 65 |es = tes|tForPrGe|
|00000cd0| 6e 65 72 61 6c 20 28 29 | 3b 20 20 2f 2f 20 43 68 |neral ()|; // Ch|
|00000ce0| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 74 68 |eck to s|ee if th|
|00000cf0| 65 20 63 75 72 72 65 6e | 74 20 70 72 69 6e 74 65 |e curren|t printe|
|00000d00| 72 20 64 72 69 76 65 72 | 20 0d 09 20 09 20 20 20 |r driver| .. . |
|00000d10| 65 6c 73 65 20 6d 79 50 | 72 69 6e 74 45 72 72 20 |else myP|rintErr |
|00000d20| 3d 20 50 72 45 72 72 6f | 72 20 28 29 3b 09 09 09 |= PrErro|r ();...|
|00000d30| 20 2f 2f 20 73 75 70 70 | 6f 72 74 73 20 50 72 47 | // supp|orts PrG|
|00000d40| 65 6e 65 72 61 6c 20 61 | 6e 64 20 73 65 74 20 74 |eneral a|nd set t|
|00000d50| 68 65 20 67 6c 6f 62 61 | 6c 20 66 6c 61 67 2e 2e |he globa|l flag..|
|00000d60| 2e 0d 09 20 09 20 20 7d | 0d 09 09 65 6c 73 65 20 |... . }|...else |
|00000d70| 6d 79 50 72 69 6e 74 45 | 72 72 20 3d 20 50 72 45 |myPrintE|rr = PrE|
|00000d80| 72 72 6f 72 20 28 29 3b | 20 20 20 20 2f 2f 20 47 |rror ();| // G|
|00000d90| 72 61 62 20 74 68 65 20 | 65 72 72 6f 72 20 62 65 |rab the |error be|
|00000da0| 66 6f 72 65 20 77 65 20 | 63 6c 6f 73 65 20 74 68 |fore we |close th|
|00000db0| 65 20 50 72 69 6e 74 20 | 4d 61 6e 61 67 65 72 0d |e Print |Manager.|
|00000dc0| 20 20 20 20 20 20 20 50 | 72 43 6c 6f 73 65 28 29 | P|rClose()|
|00000dd0| 3b 0d 09 20 20 0d 09 20 | 20 20 69 66 20 28 6d 79 |;.. .. | if (my|
|00000de0| 50 72 69 6e 74 45 72 72 | 20 21 3d 20 30 29 20 20 |PrintErr| != 0) |
|00000df0| 0d 09 20 20 20 20 20 41 | 6c 65 72 74 55 73 65 72 |.. A|lertUser|
|00000e00| 20 28 29 3b 0d 09 20 20 | 7d 0d 09 20 65 6c 73 65 | ();.. |}.. else|
|00000e10| 20 20 41 6c 65 72 74 55 | 73 65 72 20 28 29 3b 0d | AlertU|ser ();.|
|00000e20| 7d 0d 0d 2f 2a 20 43 6c | 65 61 6e 20 75 70 20 61 |}../* Cl|ean up a|
|00000e30| 6e 64 20 65 78 69 74 2e | 20 2a 2f 0d 20 0d 23 70 |nd exit.| */. .#p|
|00000e40| 72 61 67 6d 61 20 73 65 | 67 6d 65 6e 74 20 4d 61 |ragma se|gment Ma|
|00000e50| 69 6e 0d 76 6f 69 64 20 | 50 72 69 6e 74 54 65 72 |in.void |PrintTer|
|00000e60| 6d 69 6e 61 74 65 28 29 | 0d 7b 0d 09 69 66 20 28 |minate()|.{..if (|
|00000e70| 67 50 72 52 65 63 48 64 | 6c 20 21 3d 20 6e 69 6c |gPrRecHd|l != nil|
|00000e80| 29 20 20 20 20 0d 09 20 | 20 44 69 73 70 6f 73 48 |) .. | DisposH|
|00000e90| 61 6e 64 6c 65 20 28 28 | 48 61 6e 64 6c 65 29 20 |andle ((|Handle) |
|00000ea0| 67 50 72 52 65 63 48 64 | 6c 29 3b 20 20 20 20 20 |gPrRecHd|l); |
|00000eb0| 2f 2f 20 44 69 73 70 6f | 73 65 20 6f 66 20 74 68 |// Dispo|se of th|
|00000ec0| 65 20 70 72 69 6e 74 20 | 72 65 63 6f 72 64 0d 09 |e print |record..|
|00000ed0| 0d 7d 20 2f 2a 54 65 72 | 6d 69 6e 61 74 65 2a 2f |.} /*Ter|minate*/|
|00000ee0| 0d 0d 0d 2f 2a 09 44 69 | 73 70 6c 61 79 20 61 6e |.../*.Di|splay an|
|00000ef0| 20 61 6c 65 72 74 20 74 | 68 61 74 20 74 65 6c 6c | alert t|hat tell|
|00000f00| 73 20 74 68 65 20 75 73 | 65 72 20 61 6e 20 65 72 |s the us|er an er|
|00000f10| 72 6f 72 20 6f 63 63 75 | 72 72 65 64 2e 0d 09 54 |ror occu|rred...T|
|00000f20| 68 69 73 20 72 6f 75 74 | 69 6e 65 20 69 73 20 75 |his rout|ine is u|
|00000f30| 73 65 64 20 61 73 20 61 | 6e 20 75 6c 74 69 6d 61 |sed as a|n ultima|
|00000f40| 74 65 20 62 61 69 6c 2d | 6f 75 74 20 66 6f 72 20 |te bail-|out for |
|00000f50| 73 65 72 69 6f 75 73 20 | 65 72 72 6f 72 73 20 74 |serious |errors t|
|00000f60| 68 61 74 20 70 72 6f 68 | 69 62 69 74 0d 09 74 68 |hat proh|ibit..th|
|00000f70| 65 20 63 6f 6e 74 69 6e | 75 61 74 69 6f 6e 20 6f |e contin|uation o|
|00000f80| 66 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |f the ap|plicatio|
|00000f90| 6e 2e 20 45 72 72 6f 72 | 73 20 74 68 61 74 20 64 |n. Error|s that d|
|00000fa0| 6f 20 6e 6f 74 20 72 65 | 71 75 69 72 65 20 74 68 |o not re|quire th|
|00000fb0| 65 20 74 65 72 6d 69 6e | 61 74 69 6f 6e 0d 09 6f |e termin|ation..o|
|00000fc0| 66 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |f the ap|plicatio|
|00000fd0| 6e 20 73 68 6f 75 6c 64 | 20 62 65 20 68 61 6e 64 |n should| be hand|
|00000fe0| 6c 65 64 20 69 6e 20 61 | 20 64 69 66 66 65 72 65 |led in a| differe|
|00000ff0| 6e 74 20 6d 61 6e 6e 65 | 72 2e 20 45 72 72 6f 72 |nt manne|r. Error|
|00001000| 20 63 68 65 63 6b 69 6e | 67 20 61 6e 64 0d 09 72 | checkin|g and..r|
|00001010| 65 70 6f 72 74 69 6e 67 | 20 68 61 73 20 61 20 70 |eporting| has a p|
|00001020| 6c 61 63 65 20 65 76 65 | 6e 20 69 6e 20 74 68 65 |lace eve|n in the|
|00001030| 20 73 69 6d 70 6c 65 73 | 74 20 61 70 70 6c 69 63 | simples|t applic|
|00001040| 61 74 69 6f 6e 2e 20 54 | 68 65 20 65 72 72 6f 72 |ation. T|he error|
|00001050| 20 6e 75 6d 62 65 72 20 | 69 73 20 75 73 65 64 0d | number |is used.|
|00001060| 09 74 6f 20 69 6e 64 65 | 78 20 61 6e 20 27 53 54 |.to inde|x an 'ST|
|00001070| 52 23 27 20 72 65 73 6f | 75 72 63 65 20 73 6f 20 |R#' reso|urce so |
|00001080| 74 68 61 74 20 61 20 72 | 65 6c 65 76 61 6e 74 20 |that a r|elevant |
|00001090| 6d 65 73 73 61 67 65 20 | 63 61 6e 20 62 65 20 64 |message |can be d|
|000010a0| 69 73 70 6c 61 79 65 64 | 2e 20 2a 2f 0d 0d 23 70 |isplayed|. */..#p|
|000010b0| 72 61 67 6d 61 20 73 65 | 67 6d 65 6e 74 20 4d 61 |ragma se|gment Ma|
|000010c0| 69 6e 0d 76 6f 69 64 20 | 41 6c 65 72 74 55 73 65 |in.void |AlertUse|
|000010d0| 72 28 29 0d 7b 0d 09 73 | 68 6f 72 74 09 09 69 74 |r().{..s|hort..it|
|000010e0| 65 6d 48 69 74 3b 0d 0d | 09 53 65 74 43 75 72 73 |emHit;..|.SetCurs|
|000010f0| 6f 72 28 26 71 64 2e 61 | 72 72 6f 77 29 3b 0d 09 |or(&qd.a|rrow);..|
|00001100| 69 74 65 6d 48 69 74 20 | 3d 20 41 6c 65 72 74 28 |itemHit |= Alert(|
|00001110| 72 55 73 65 72 41 6c 65 | 72 74 2c 20 6e 69 6c 29 |rUserAle|rt, nil)|
|00001120| 3b 0d 7d 20 2f 2a 20 41 | 6c 65 72 74 55 73 65 72 |;.} /* A|lertUser|
|00001130| 20 2a 2f 0d 0d 2f 2f 2d | 2d 2d 2d 2d 2d 20 6e 6f | */..//-|----- no|
|00001140| 50 72 47 65 6e 65 72 61 | 6c 41 6c 65 72 74 20 2d |PrGenera|lAlert -|
|00001150| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001160| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001170| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001180| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0d 2f 2f 0d 2f 2f |--------|--.//.//|
|00001190| 20 20 44 69 73 70 6c 61 | 79 20 74 68 65 20 61 6c | Displa|y the al|
|000011a0| 65 72 74 20 74 68 61 74 | 20 74 65 6c 6c 73 20 74 |ert that| tells t|
|000011b0| 68 65 20 75 73 65 72 20 | 74 68 61 74 20 50 72 47 |he user |that PrG|
|000011c0| 65 6e 65 72 61 6c 20 69 | 73 20 6e 6f 74 20 61 76 |eneral i|s not av|
|000011d0| 61 69 6c 61 62 6c 65 0d | 2f 2f 20 20 66 6f 72 20 |ailable.|// for |
|000011e0| 74 68 65 20 63 75 72 72 | 65 6e 74 6c 79 20 73 65 |the curr|ently se|
|000011f0| 6c 65 63 74 65 64 20 70 | 72 69 6e 74 65 72 20 64 |lected p|rinter d|
|00001200| 72 69 76 65 72 2e 2e 2e | 0d 2f 2f 0d 0d 76 6f 69 |river...|.//..voi|
|00001210| 64 20 6e 6f 50 72 47 65 | 6e 65 72 61 6c 41 6c 65 |d noPrGe|neralAle|
|00001220| 72 74 20 28 29 0d 7b 0d | 09 73 68 6f 72 74 09 09 |rt ().{.|.short..|
|00001230| 69 74 65 6d 48 69 74 3b | 0d 0d 09 53 65 74 43 75 |itemHit;|...SetCu|
|00001240| 72 73 6f 72 28 26 71 64 | 2e 61 72 72 6f 77 29 3b |rsor(&qd|.arrow);|
|00001250| 0d 09 0d 09 69 74 65 6d | 48 69 74 20 3d 20 4e 6f |....item|Hit = No|
|00001260| 74 65 41 6c 65 72 74 28 | 72 4e 4f 50 72 47 65 6e |teAlert(|rNOPrGen|
|00001270| 65 72 61 6c 41 6c 65 72 | 74 2c 20 6e 69 6c 29 3b |eralAler|t, nil);|
|00001280| 0d 7d 20 20 2f 2f 20 20 | 65 6e 64 20 6f 66 20 6e |.} // |end of n|
|00001290| 6f 50 72 47 65 6e 65 72 | 61 6c 41 6c 65 72 74 0d |oPrGener|alAlert.|
|000012a0| 0d 0d 0d 0d 2f 2f 2d 2d | 2d 2d 2d 2d 20 74 65 73 |....//--|---- tes|
|000012b0| 74 46 6f 72 50 72 47 65 | 6e 65 72 61 6c 20 2d 2d |tForPrGe|neral --|
|000012c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000012d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000012e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000012f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0d 2f 2f 0d 2f 2f 20 |--------|-.//.// |
|00001300| 20 57 65 20 77 61 6e 74 | 20 74 6f 20 64 65 74 65 | We want| to dete|
|00001310| 72 6d 69 6e 65 20 69 66 | 20 50 72 47 65 6e 65 72 |rmine if| PrGener|
|00001320| 61 6c 20 69 73 20 61 76 | 61 69 6c 61 62 6c 65 2e |al is av|ailable.|
|00001330| 20 20 49 66 20 69 74 20 | 69 73 20 6e 6f 74 2c 20 | If it |is not, |
|00001340| 74 68 65 20 70 72 69 6e | 74 65 72 20 64 72 69 76 |the prin|ter driv|
|00001350| 65 72 0d 2f 2f 20 20 77 | 69 6c 6c 20 72 65 74 75 |er.// w|ill retu|
|00001360| 72 6e 20 72 65 73 4e 6f | 74 46 6f 75 6e 64 20 69 |rn resNo|tFound i|
|00001370| 6e 20 50 72 45 72 72 6f | 72 2e 20 20 57 65 20 77 |n PrErro|r. We w|
|00001380| 69 6c 6c 20 74 68 65 6e | 20 63 6c 65 61 72 20 74 |ill then| clear t|
|00001390| 68 65 20 65 72 72 6f 72 | 20 69 6e 20 50 72 45 72 |he error| in PrEr|
|000013a0| 72 6f 72 20 77 69 74 68 | 0d 2f 2f 20 20 50 72 53 |ror with|.// PrS|
|000013b0| 65 74 45 72 72 6f 72 20 | 28 30 29 20 61 6e 64 20 |etError |(0) and |
|000013c0| 70 72 6f 63 65 65 64 20 | 77 69 74 68 20 70 72 69 |proceed |with pri|
|000013d0| 6e 74 69 6e 67 20 77 69 | 74 68 6f 75 74 20 50 72 |nting wi|thout Pr|
|000013e0| 47 65 6e 65 72 61 6c 27 | 73 20 6f 70 63 6f 64 65 |General'|s opcode|
|000013f0| 73 2e 20 20 49 66 20 77 | 65 20 64 69 64 20 6e 6f |s. If w|e did no|
|00001400| 74 0d 2f 2f 20 20 63 6c | 65 61 72 20 74 68 65 20 |t.// cl|ear the |
|00001410| 65 72 72 6f 72 2c 20 79 | 6f 75 20 77 6f 75 6c 64 |error, y|ou would|
|00001420| 20 72 65 63 65 69 76 65 | 20 74 68 65 20 65 72 72 | receive| the err|
|00001430| 6f 72 20 69 6e 20 50 72 | 45 72 72 6f 72 20 77 68 |or in Pr|Error wh|
|00001440| 65 6e 20 69 74 20 77 61 | 73 20 63 68 65 63 6b 65 |en it wa|s checke|
|00001450| 64 2c 20 74 68 65 72 65 | 62 79 0d 2f 2f 20 20 70 |d, there|by.// p|
|00001460| 72 65 76 65 6e 74 69 6e | 67 20 79 6f 75 72 20 61 |reventin|g your a|
|00001470| 70 70 20 66 72 6f 6d 20 | 70 72 69 6e 74 69 6e 67 |pp from |printing|
|00001480| 2e 0d 0d 42 6f 6f 6c 65 | 61 6e 20 74 65 73 74 46 |...Boole|an testF|
|00001490| 6f 72 50 72 47 65 6e 65 | 72 61 6c 20 28 29 0d 7b |orPrGene|ral ().{|
|000014a0| 0d 20 20 09 54 47 65 74 | 52 6f 74 6e 42 6c 6b 09 |. .TGet|RotnBlk.|
|000014b0| 47 65 74 52 6f 74 52 65 | 63 3b 0d 20 20 09 73 68 |GetRotRe|c;. .sh|
|000014c0| 6f 72 74 20 20 09 09 70 | 72 69 6e 74 45 72 72 20 |ort ..p|rintErr |
|000014d0| 3d 20 30 3b 0d 20 20 0d | 20 20 20 20 47 65 74 52 |= 0;. .| GetR|
|000014e0| 6f 74 52 65 63 2e 69 4f | 70 43 6f 64 65 20 3d 20 |otRec.iO|pCode = |
|000014f0| 67 65 74 52 6f 74 6e 4f | 70 3b 20 20 20 20 2f 2f |getRotnO|p; //|
|00001500| 20 57 65 20 77 69 6c 6c | 20 74 65 73 74 20 66 6f | We will| test fo|
|00001510| 72 20 50 72 47 65 6e 65 | 72 61 6c 20 77 69 74 68 |r PrGene|ral with|
|00001520| 20 74 68 65 20 6c 61 6e | 64 73 63 61 70 65 20 6f | the lan|dscape o|
|00001530| 70 63 6f 64 65 2e 2e 2e | 0d 20 20 20 20 47 65 74 |pcode...|. Get|
|00001540| 52 6f 74 52 65 63 2e 68 | 50 72 69 6e 74 20 3d 20 |RotRec.h|Print = |
|00001550| 67 50 72 52 65 63 48 64 | 6c 3b 0d 20 0d 20 20 09 |gPrRecHd|l;. . .|
|00001560| 50 72 47 65 6e 65 72 61 | 6c 20 28 28 50 74 72 29 |PrGenera|l ((Ptr)|
|00001570| 20 26 47 65 74 52 6f 74 | 52 65 63 29 3b 09 0d 20 | &GetRot|Rec);.. |
|00001580| 20 0d 20 20 09 70 72 69 | 6e 74 45 72 72 20 3d 20 | . .pri|ntErr = |
|00001590| 50 72 45 72 72 6f 72 20 | 28 29 3b 0d 20 20 0d 20 |PrError |();. . |
|000015a0| 20 09 69 66 20 28 70 72 | 69 6e 74 45 72 72 20 3d | .if (pr|intErr =|
|000015b0| 3d 20 6e 6f 45 72 72 29 | 20 20 20 20 20 20 20 20 |= noErr)| |
|000015c0| 20 20 20 20 2f 2f 20 20 | 50 72 47 65 6e 65 72 61 | // |PrGenera|
|000015d0| 6c 20 69 73 20 73 75 70 | 70 6f 72 74 65 64 20 62 |l is sup|ported b|
|000015e0| 79 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 64 72 |y the cu|rrent dr|
|000015f0| 69 76 65 72 2e 2e 2e 0d | 20 20 20 20 20 20 72 65 |iver....| re|
|00001600| 74 75 72 6e 20 28 74 72 | 75 65 29 3b 0d 20 20 09 |turn (tr|ue);. .|
|00001610| 65 6c 73 65 20 0d 20 20 | 20 20 20 20 7b 0d 09 20 |else . | {.. |
|00001620| 20 20 69 66 20 28 70 72 | 69 6e 74 45 72 72 20 3d | if (pr|intErr =|
|00001630| 3d 20 72 65 73 4e 6f 74 | 46 6f 75 6e 64 29 0d 20 |= resNot|Found). |
|00001640| 20 20 20 20 20 20 20 20 | 7b 0d 09 20 20 20 20 20 | |{.. |
|00001650| 20 20 50 72 53 65 74 45 | 72 72 6f 72 20 28 6e 6f | PrSetE|rror (no|
|00001660| 45 72 72 29 3b 20 20 20 | 20 20 20 20 20 2f 2f 20 |Err); | // |
|00001670| 53 69 6e 63 65 20 50 72 | 47 65 6e 65 72 61 6c 20 |Since Pr|General |
|00001680| 69 73 20 6e 6f 74 20 61 | 76 61 69 6c 61 62 6c 65 |is not a|vailable|
|00001690| 2c 20 77 65 20 77 61 6e | 74 20 74 6f 20 63 6c 65 |, we wan|t to cle|
|000016a0| 61 72 20 50 72 45 72 72 | 6f 72 2c 0d 09 20 20 20 |ar PrErr|or,.. |
|000016b0| 20 20 20 20 6e 6f 50 72 | 47 65 6e 65 72 61 6c 41 | noPr|GeneralA|
|000016c0| 6c 65 72 74 20 28 29 3b | 20 20 20 20 20 20 20 2f |lert ();| /|
|000016d0| 2f 20 77 68 69 63 68 20 | 77 69 6c 6c 20 65 6e 61 |/ which |will ena|
|000016e0| 62 6c 65 20 79 6f 75 72 | 20 61 70 70 20 74 6f 20 |ble your| app to |
|000016f0| 6b 65 65 70 20 70 72 69 | 6e 74 69 6e 67 20 77 69 |keep pri|nting wi|
|00001700| 74 68 6f 75 74 0d 09 20 | 20 20 20 20 20 20 72 65 |thout.. | re|
|00001710| 74 75 72 6e 20 28 66 61 | 6c 73 65 29 3b 20 20 20 |turn (fa|lse); |
|00001720| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 50 72 47 65 | | // PrGe|
|00001730| 6e 65 72 61 6c 27 73 20 | 6f 70 63 6f 64 65 73 2e |neral's |opcodes.|
|00001740| 2e 2e 0d 09 20 20 20 20 | 20 7d 0d 09 20 20 20 65 |.... | }.. e|
|00001750| 6c 73 65 20 0d 09 20 20 | 20 20 7b 0d 09 20 20 20 |lse .. | {.. |
|00001760| 20 20 20 50 72 43 6c 6f | 73 65 20 28 29 3b 0d 20 | PrClo|se ();. |
|00001770| 20 20 20 20 20 20 20 20 | 20 41 6c 65 72 74 55 73 | | AlertUs|
|00001780| 65 72 20 28 29 3b 20 20 | 20 20 20 20 20 20 20 20 |er (); | |
|00001790| 20 20 20 20 20 2f 2f 20 | 41 6e 6f 74 68 65 72 20 | // |Another |
|000017a0| 74 79 70 65 20 6f 66 20 | 70 72 69 6e 74 20 65 72 |type of |print er|
|000017b0| 72 6f 72 20 6f 63 63 75 | 72 72 65 64 2c 20 74 68 |ror occu|rred, th|
|000017c0| 65 72 65 66 6f 72 65 20 | 41 6c 65 72 74 55 73 65 |erefore |AlertUse|
|000017d0| 72 0d 09 20 20 20 20 7d | 0d 09 20 20 7d 0d 7d 20 |r.. }|.. }.} |
|000017e0| 20 2f 2f 20 20 65 6e 64 | 20 6f 66 20 74 65 73 74 | // end| of test|
|000017f0| 46 6f 72 50 72 47 65 6e | 65 72 61 6c 0d 0d 0d 0d |ForPrGen|eral....|
|00001800| 2f 2f 2d 2d 2d 2d 2d 2d | 20 73 61 76 65 52 65 73 |//------| saveRes|
|00001810| 6f 6c 75 74 69 6f 6e 20 | 2d 2d 2d 2d 2d 2d 2d 2d |olution |--------|
|00001820| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001830| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001840| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001850| 2d 2d 2d 2d 2d 0d 2f 2f | 0d 2f 2f 09 57 65 20 6e |-----.//|.//.We n|
|00001860| 65 65 64 20 74 6f 20 73 | 61 76 65 20 74 68 65 20 |eed to s|ave the |
|00001870| 6f 72 69 67 69 6e 61 6c | 20 72 65 73 6f 6c 75 74 |original| resolut|
|00001880| 69 6f 6e 20 6f 66 20 74 | 68 65 20 63 75 72 72 65 |ion of t|he curre|
|00001890| 6e 74 20 70 72 69 6e 74 | 65 72 20 64 72 69 76 65 |nt print|er drive|
|000018a0| 72 2c 20 77 68 69 63 68 | 20 77 69 6c 6c 0d 2f 2f |r, which| will.//|
|000018b0| 09 65 6e 61 62 6c 65 20 | 75 73 20 74 6f 20 72 65 |.enable |us to re|
|000018c0| 73 65 74 20 74 68 65 20 | 72 65 73 6f 6c 75 74 69 |set the |resoluti|
|000018d0| 75 6f 6e 20 69 66 20 74 | 68 65 20 75 73 65 72 20 |uon if t|he user |
|000018e0| 74 75 72 6e 73 20 74 68 | 65 20 22 68 69 67 68 20 |turns th|e "high |
|000018f0| 72 65 73 6f 6c 75 74 69 | 6f 6e 22 20 70 72 69 6e |resoluti|on" prin|
|00001900| 74 69 6e 67 0d 2f 2f 09 | 6d 65 6e 75 20 69 74 65 |ting.//.|menu ite|
|00001910| 6d 20 22 6f 66 66 22 2e | 0d 2f 2f 0d 0d 76 6f 69 |m "off".|.//..voi|
|00001920| 64 20 73 61 76 65 52 65 | 73 6f 6c 75 74 69 6f 6e |d saveRe|solution|
|00001930| 20 28 29 0d 7b 0d 09 67 | 4f 72 69 67 69 6e 61 6c | ().{..g|Original|
|00001940| 69 56 52 65 73 20 3d 20 | 28 2a 2a 67 50 72 52 65 |iVRes = |(**gPrRe|
|00001950| 63 48 64 6c 29 2e 70 72 | 49 6e 66 6f 2e 69 56 52 |cHdl).pr|Info.iVR|
|00001960| 65 73 3b 0d 09 67 4f 72 | 69 67 69 6e 61 6c 69 48 |es;..gOr|iginaliH|
|00001970| 52 65 73 20 3d 20 28 2a | 2a 67 50 72 52 65 63 48 |Res = (*|*gPrRecH|
|00001980| 64 6c 29 2e 70 72 49 6e | 66 6f 2e 69 48 52 65 73 |dl).prIn|fo.iHRes|
|00001990| 3b 0d 7d 0d 0d 0d 0d 2f | 2f 2d 2d 2d 2d 2d 2d 20 |;.}..../|/------ |
|000019a0| 72 65 73 65 74 53 65 74 | 52 73 6c 20 2d 2d 2d 2d |resetSet|Rsl ----|
|000019b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000019c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000019d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000019e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 2f 2f 0d |--------|----.//.|
|000019f0| 2f 2f 09 72 65 73 65 74 | 53 65 74 52 73 6c 20 77 |//.reset|SetRsl w|
|00001a00| 69 6c 6c 20 72 65 73 65 | 74 20 74 68 65 20 72 65 |ill rese|t the re|
|00001a10| 73 6f 6c 75 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |solution| of the |
|00001a20| 70 72 69 6e 74 20 68 61 | 6e 64 6c 65 2c 20 62 61 |print ha|ndle, ba|
|00001a30| 63 6b 20 74 6f 20 69 74 | 27 73 20 6f 72 67 69 6e |ck to it|'s orgin|
|00001a40| 61 6c 20 0d 2f 2f 09 62 | 65 66 6f 72 65 20 75 73 |al .//.b|efore us|
|00001a50| 69 6e 67 20 74 68 65 20 | 53 65 74 52 73 6c 20 6f |ing the |SetRsl o|
|00001a60| 70 63 6f 64 65 2e 20 20 | 49 66 20 74 68 65 20 75 |pcode. |If the u|
|00001a70| 73 65 72 20 68 61 73 20 | 6e 6f 74 20 63 68 61 6e |ser has |not chan|
|00001a80| 67 65 64 20 74 68 65 20 | 70 72 69 6e 74 65 72 2c |ged the |printer,|
|00001a90| 20 77 65 20 0d 2f 2f 09 | 77 69 6c 6c 20 72 65 73 | we .//.|will res|
|00001aa0| 65 74 20 74 68 65 20 72 | 65 73 6f 6c 75 74 69 6f |et the r|esolutio|
|00001ab0| 6e 20 6f 66 20 74 68 65 | 20 70 72 69 6e 74 65 72 |n of the| printer|
|00001ac0| 20 64 72 69 76 65 72 20 | 77 69 74 68 20 61 20 63 | driver |with a c|
|00001ad0| 61 6c 6c 20 74 6f 20 74 | 68 65 20 53 65 74 52 73 |all to t|he SetRs|
|00001ae0| 6c 20 6f 70 63 6f 64 65 | 20 0d 2f 2f 20 20 77 69 |l opcode| .// wi|
|00001af0| 74 68 20 74 68 65 20 6f | 72 67 69 6e 61 6c 20 72 |th the o|rginal r|
|00001b00| 65 73 6f 6c 75 74 69 6f | 6e 73 20 74 68 61 74 20 |esolutio|ns that |
|00001b10| 77 65 72 65 20 73 61 76 | 65 64 20 62 79 20 74 68 |were sav|ed by th|
|00001b20| 65 20 66 75 6e 63 74 69 | 6f 6e 20 73 61 76 65 52 |e functi|on saveR|
|00001b30| 65 73 6f 6c 75 74 69 6f | 6e 2e 20 49 66 20 0d 2f |esolutio|n. If ./|
|00001b40| 2f 20 20 74 68 65 20 75 | 73 65 72 20 68 61 73 20 |/ the u|ser has |
|00001b50| 73 65 6c 65 63 74 65 64 | 20 61 20 64 69 66 66 65 |selected| a diffe|
|00001b60| 72 65 6e 74 20 70 72 69 | 6e 74 65 72 20 76 69 61 |rent pri|nter via|
|00001b70| 20 74 68 65 20 43 68 6f | 6f 73 65 72 2c 20 77 65 | the Cho|oser, we|
|00001b80| 20 77 69 6c 6c 20 63 61 | 6c 6c 20 50 72 69 6e 74 | will ca|ll Print|
|00001b90| 44 65 66 61 75 6c 74 20 | 0d 2f 2f 20 20 6f 6e 20 |Default |.// on |
|00001ba0| 6f 75 72 20 70 72 69 6e | 74 20 72 65 63 6f 72 64 |our prin|t record|
|00001bb0| 2e 20 20 0d 2f 2f 0d 0d | 76 6f 69 64 20 72 65 73 |. .//..|void res|
|00001bc0| 65 74 53 65 74 52 73 6c | 20 28 29 0d 7b 0d 09 54 |etSetRsl| ().{..T|
|00001bd0| 53 65 74 52 73 6c 42 6c | 6b 09 73 65 74 52 65 73 |SetRslBl|k.setRes|
|00001be0| 52 65 63 3b 0d 09 54 48 | 50 72 69 6e 74 20 09 6c |Rec;..TH|Print .l|
|00001bf0| 6f 63 61 6c 50 72 52 65 | 63 48 64 6c 3b 0d 09 73 |ocalPrRe|cHdl;..s|
|00001c00| 68 6f 72 74 09 09 6c 61 | 74 65 73 74 44 72 69 76 |hort..la|testDriv|
|00001c10| 65 72 56 65 72 73 3b 0d | 0d 09 2f 2f 20 20 43 72 |erVers;.|..// Cr|
|00001c20| 65 61 74 65 20 61 20 22 | 6e 65 77 22 20 70 72 69 |eate a "|new" pri|
|00001c30| 6e 74 20 72 65 63 6f 72 | 64 20 74 6f 20 63 6f 6d |nt recor|d to com|
|00001c40| 70 61 72 65 20 77 69 74 | 68 2e 2e 2e 0d 09 0d 09 |pare wit|h.......|
|00001c50| 6c 6f 63 61 6c 50 72 52 | 65 63 48 64 6c 20 3d 20 |localPrR|ecHdl = |
|00001c60| 28 54 48 50 72 69 6e 74 | 29 20 4e 65 77 48 61 6e |(THPrint|) NewHan|
|00001c70| 64 6c 65 28 73 69 7a 65 | 6f 66 28 54 50 72 69 6e |dle(size|of(TPrin|
|00001c80| 74 29 29 3b 0d 09 69 66 | 20 28 4d 65 6d 45 72 72 |t));..if| (MemErr|
|00001c90| 6f 72 28 29 20 3d 3d 20 | 6e 6f 45 72 72 20 26 26 |or() == |noErr &&|
|00001ca0| 20 6c 6f 63 61 6c 50 72 | 52 65 63 48 64 6c 20 21 | localPr|RecHdl !|
|00001cb0| 3d 20 6e 69 6c 29 0d 09 | 7b 0d 09 09 50 72 69 6e |= nil)..|{...Prin|
|00001cc0| 74 44 65 66 61 75 6c 74 | 20 28 6c 6f 63 61 6c 50 |tDefault| (localP|
|00001cd0| 72 52 65 63 48 64 6c 29 | 3b 0d 09 0d 09 09 6c 61 |rRecHdl)|;.....la|
|00001ce0| 74 65 73 74 44 72 69 76 | 65 72 56 65 72 73 20 3d |testDriv|erVers =|
|00001cf0| 20 50 72 44 72 76 72 56 | 65 72 73 20 28 29 3b 0d | PrDrvrV|ers ();.|
|00001d00| 09 0d 09 09 2f 2f 20 09 | 57 65 20 6e 65 65 64 20 |....// .|We need |
|00001d10| 74 6f 20 64 65 74 65 72 | 6d 69 6e 65 20 69 66 20 |to deter|mine if |
|00001d20| 74 68 65 20 75 73 65 72 | 20 63 68 61 6e 67 65 64 |the user| changed|
|00001d30| 20 74 68 65 20 70 72 69 | 6e 74 65 72 20 64 72 69 | the pri|nter dri|
|00001d40| 76 65 72 20 76 69 61 20 | 43 68 6f 6f 73 65 72 2e |ver via |Chooser.|
|00001d50| 20 20 0d 09 09 2f 2f 09 | 57 68 69 63 68 20 77 6f | ...//.|Which wo|
|00001d60| 75 6c 64 20 62 65 20 61 | 20 70 72 6f 62 6c 65 6d |uld be a| problem|
|00001d70| 20 62 65 63 61 75 73 65 | 20 74 68 65 20 72 65 73 | because| the res|
|00001d80| 6f 6c 75 74 69 6f 6e 73 | 20 6d 69 67 68 74 20 6e |olutions| might n|
|00001d90| 6f 74 20 6d 61 74 63 68 | 20 61 63 72 6f 73 73 20 |ot match| across |
|00001da0| 0d 09 09 2f 2f 09 64 69 | 66 66 65 72 65 6e 74 20 |...//.di|fferent |
|00001db0| 70 72 69 6e 74 65 72 20 | 64 72 69 76 65 72 73 2e |printer |drivers.|
|00001dc0| 20 57 65 20 61 6c 73 6f | 20 63 68 65 63 6b 20 74 | We also| check t|
|00001dd0| 6f 20 73 65 65 20 69 66 | 20 74 68 65 20 76 65 72 |o see if| the ver|
|00001de0| 73 69 6f 6e 20 6e 75 6d | 62 65 72 20 68 61 73 20 |sion num|ber has |
|00001df0| 0d 09 09 2f 2f 09 63 68 | 61 6e 67 65 64 2c 20 77 |...//.ch|anged, w|
|00001e00| 68 69 63 68 20 77 69 6c | 6c 20 69 6e 73 75 72 65 |hich wil|l insure|
|00001e10| 20 74 68 61 74 20 74 68 | 65 20 75 73 65 72 20 64 | that th|e user d|
|00001e20| 69 64 20 6e 6f 74 20 63 | 68 61 6e 67 65 20 74 68 |id not c|hange th|
|00001e30| 65 20 70 72 69 6e 74 65 | 72 20 64 72 69 76 65 72 |e printe|r driver|
|00001e40| 0d 09 09 2f 2f 09 74 6f | 20 61 20 64 69 66 66 65 |...//.to| a diffe|
|00001e50| 72 65 6e 74 20 70 72 69 | 6e 74 65 72 20 64 72 69 |rent pri|nter dri|
|00001e60| 76 65 72 20 76 65 72 73 | 69 6f 6e 2e 20 20 54 68 |ver vers|ion. Th|
|00001e70| 69 73 20 69 73 20 69 6d | 70 6f 72 74 61 6e 74 2c |is is im|portant,|
|00001e80| 20 62 65 63 61 75 73 65 | 20 65 61 72 6c 69 65 72 | because| earlier|
|00001e90| 0d 09 09 2f 2f 09 76 65 | 72 73 69 6f 6e 73 20 6f |...//.ve|rsions o|
|00001ea0| 66 20 74 68 65 20 49 6d | 61 67 65 57 72 69 74 65 |f the Im|ageWrite|
|00001eb0| 72 20 28 69 2e 65 2e 20 | 62 65 66 6f 72 65 20 76 |r (i.e. |before v|
|00001ec0| 32 2e 35 29 20 64 69 64 | 20 6e 6f 74 20 73 75 70 |2.5) did| not sup|
|00001ed0| 70 6f 72 74 20 50 72 47 | 65 6e 65 72 61 6c 2e 0d |port PrG|eneral..|
|00001ee0| 09 09 2f 2f 20 20 49 66 | 20 74 68 65 79 20 68 61 |..// If| they ha|
|00001ef0| 76 65 20 63 68 61 6e 67 | 65 64 20 74 68 65 20 70 |ve chang|ed the p|
|00001f00| 72 69 6e 74 65 72 20 64 | 72 69 76 65 72 2c 20 63 |rinter d|river, c|
|00001f10| 61 6c 6c 20 50 72 69 6e | 74 44 65 66 61 75 6c 74 |all Prin|tDefault|
|00001f20| 20 6f 6e 20 6f 75 72 20 | 67 6c 6f 62 61 6c 20 70 | on our |global p|
|00001f30| 72 69 6e 74 20 0d 09 09 | 2f 2f 20 20 72 65 63 6f |rint ...|// reco|
|00001f40| 72 64 20 68 61 6e 64 6c | 65 20 74 6f 20 75 70 64 |rd handl|e to upd|
|00001f50| 61 74 65 20 69 74 2e 0d | 09 09 0d 09 09 69 66 20 |ate it..|.....if |
|00001f60| 28 28 28 28 2a 2a 67 50 | 72 52 65 63 48 64 6c 29 |((((**gP|rRecHdl)|
|00001f70| 2e 70 72 53 74 6c 2e 77 | 44 65 76 29 20 3e 3e 20 |.prStl.w|Dev) >> |
|00001f80| 38 29 20 3d 3d 20 28 28 | 28 2a 2a 6c 6f 63 61 6c |8) == ((|(**local|
|00001f90| 50 72 52 65 63 48 64 6c | 29 2e 70 72 53 74 6c 2e |PrRecHdl|).prStl.|
|00001fa0| 77 44 65 76 29 20 3e 3e | 20 38 29 0d 09 09 09 20 |wDev) >>| 8).... |
|00001fb0| 7c 7c 20 28 6c 61 74 65 | 73 74 44 72 69 76 65 72 ||| (late|stDriver|
|00001fc0| 56 65 72 73 20 3d 3d 20 | 67 4f 72 69 67 69 6e 61 |Vers == |gOrigina|
|00001fd0| 6c 44 72 69 76 65 72 56 | 65 72 73 29 29 0d 09 09 |lDriverV|ers))...|
|00001fe0| 20 20 7b 0d 09 09 09 2f | 2f 09 52 65 73 65 74 20 | {..../|/.Reset |
|00001ff0| 74 68 65 20 70 72 69 6e | 74 20 72 65 63 6f 72 64 |the prin|t record|
|00002000| 20 74 6f 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c | to the |original|
|00002010| 20 72 65 73 6f 6c 75 74 | 69 6f 6e 73 2e 2e 2e 0d | resolut|ions....|
|00002020| 09 09 09 0d 09 09 09 73 | 65 74 52 65 73 52 65 63 |.......s|etResRec|
|00002030| 2e 69 4f 70 43 6f 64 65 | 20 3d 20 73 65 74 52 73 |.iOpCode| = setRs|
|00002040| 6c 4f 70 3b 0d 09 09 09 | 73 65 74 52 65 73 52 65 |lOp;....|setResRe|
|00002050| 63 2e 68 50 72 69 6e 74 | 20 3d 20 67 50 72 52 65 |c.hPrint| = gPrRe|
|00002060| 63 48 64 6c 3b 0d 09 0d | 09 09 09 73 65 74 52 65 |cHdl;...|...setRe|
|00002070| 73 52 65 63 2e 69 58 52 | 73 6c 20 3d 20 67 4f 72 |sRec.iXR|sl = gOr|
|00002080| 69 67 69 6e 61 6c 69 48 | 52 65 73 3b 0d 09 09 09 |iginaliH|Res;....|
|00002090| 73 65 74 52 65 73 52 65 | 63 2e 69 59 52 73 6c 20 |setResRe|c.iYRsl |
|000020a0| 3d 20 67 4f 72 69 67 69 | 6e 61 6c 69 56 52 65 73 |= gOrigi|naliVRes|
|000020b0| 3b 0d 09 09 09 0d 09 09 | 09 20 0d 09 09 09 2f 2f |;.......|. ....//|
|000020c0| 20 57 65 20 64 6f 20 6e | 6f 74 20 6e 65 65 64 20 | We do n|ot need |
|000020d0| 74 6f 20 63 68 65 63 6b | 20 61 6e 79 20 50 72 47 |to check| any PrG|
|000020e0| 65 6e 65 72 61 6c 20 65 | 72 72 6f 72 73 2e 20 57 |eneral e|rrors. W|
|000020f0| 68 79 3f 20 57 65 20 6b | 6e 6f 77 20 74 68 61 74 |hy? We k|now that|
|00002100| 20 74 68 69 73 20 6f 70 | 63 6f 64 65 20 0d 09 09 | this op|code ...|
|00002110| 09 2f 2f 20 69 73 20 73 | 75 70 70 6f 72 74 65 64 |.// is s|upported|
|00002120| 20 61 6e 64 20 77 65 20 | 61 72 65 20 6e 6f 74 20 | and we |are not |
|00002130| 75 73 69 6e 67 20 61 6e | 20 75 6e 73 75 70 70 6f |using an| unsuppo|
|00002140| 72 74 65 64 20 72 65 73 | 6f 6c 75 74 69 6f 6e 2e |rted res|olution.|
|00002150| 2e 2e 0d 09 09 09 0d 09 | 09 09 50 72 47 65 6e 65 |........|..PrGene|
|00002160| 72 61 6c 20 28 28 50 74 | 72 29 28 26 73 65 74 52 |ral ((Pt|r)(&setR|
|00002170| 65 73 52 65 63 29 29 3b | 09 20 0d 09 0d 09 09 09 |esRec));|. ......|
|00002180| 67 53 63 61 6c 65 20 3d | 20 31 3b 0d 09 09 09 67 |gScale =| 1;....g|
|00002190| 4d 61 78 44 50 49 20 3d | 20 67 4f 72 69 67 69 6e |MaxDPI =| gOrigin|
|000021a0| 61 6c 69 48 52 65 73 3b | 09 09 09 09 0d 09 0d 09 |aliHRes;|........|
|000021b0| 09 09 69 66 20 28 50 72 | 45 72 72 6f 72 20 28 29 |..if (Pr|Error ()|
|000021c0| 20 21 3d 20 6e 6f 45 72 | 72 29 0d 09 09 09 20 7b | != noEr|r).... {|
|000021d0| 0d 09 09 09 20 20 20 50 | 72 43 6c 6f 73 65 20 28 |.... P|rClose (|
|000021e0| 29 3b 20 20 20 20 20 20 | 20 20 20 20 2f 2f 20 20 |); | // |
|000021f0| 57 65 20 72 65 63 65 69 | 76 65 64 20 61 6e 20 65 |We recei|ved an e|
|00002200| 72 72 6f 72 20 69 6e 20 | 50 72 45 72 72 6f 72 20 |rror in |PrError |
|00002210| 61 66 74 65 72 20 63 61 | 6c 6c 69 6e 67 20 50 72 |after ca|lling Pr|
|00002220| 47 65 6e 65 72 61 6c 2e | 0d 09 09 09 20 20 20 41 |General.|.... A|
|00002230| 6c 65 72 74 55 73 65 72 | 20 28 29 3b 20 20 20 20 |lertUser| (); |
|00002240| 20 20 20 20 2f 2f 20 20 | 54 68 65 72 65 66 6f 72 | // |Therefor|
|00002250| 65 2c 20 63 6c 6f 73 65 | 20 74 68 65 20 50 72 69 |e, close| the Pri|
|00002260| 6e 74 20 4d 61 6e 61 67 | 65 72 20 61 6e 64 20 61 |nt Manag|er and a|
|00002270| 6c 65 72 74 20 74 68 65 | 20 75 73 65 72 2e 0d 09 |lert the| user...|
|00002280| 09 09 20 7d 0d 09 09 20 | 20 7d 0d 09 09 20 65 6c |.. }... | }... el|
|00002290| 73 65 20 20 50 72 69 6e | 74 44 65 66 61 75 6c 74 |se Prin|tDefault|
|000022a0| 20 28 67 50 72 52 65 63 | 48 64 6c 29 3b 09 0d 09 | (gPrRec|Hdl);...|
|000022b0| 09 09 0d 09 09 69 66 20 | 28 6c 6f 63 61 6c 50 72 |.....if |(localPr|
|000022c0| 52 65 63 48 64 6c 20 21 | 3d 20 6e 69 6c 29 20 20 |RecHdl !|= nil) |
|000022d0| 44 69 73 70 6f 73 48 61 | 6e 64 6c 65 28 28 48 61 |DisposHa|ndle((Ha|
|000022e0| 6e 64 6c 65 29 20 6c 6f | 63 61 6c 50 72 52 65 63 |ndle) lo|calPrRec|
|000022f0| 48 64 6c 29 3b 0d 09 7d | 0d 0d 09 09 2f 2f 20 41 |Hdl);..}|....// A|
|00002300| 6e 20 65 72 72 6f 72 20 | 6f 63 63 75 72 72 65 64 |n error |occurred|
|00002310| 20 61 6c 6c 6f 63 61 74 | 69 6e 67 20 6e 65 77 20 | allocat|ing new |
|00002320| 70 72 69 6e 74 20 72 65 | 63 6f 72 64 2c 20 63 6c |print re|cord, cl|
|00002330| 6f 73 65 20 74 68 65 20 | 50 72 69 6e 74 20 4d 61 |ose the |Print Ma|
|00002340| 6e 61 67 65 72 20 61 6e | 64 20 61 6c 65 72 74 20 |nager an|d alert |
|00002350| 74 68 65 20 75 73 65 72 | 0d 09 65 6c 73 65 0d 09 |the user|..else..|
|00002360| 7b 0d 09 09 50 72 43 6c | 6f 73 65 20 28 29 3b 0d |{...PrCl|ose ();.|
|00002370| 09 09 41 6c 65 72 74 55 | 73 65 72 28 29 3b 0d 09 |..AlertU|ser();..|
|00002380| 7d 0d 0d 7d 09 2f 2f 20 | 20 65 6e 64 20 6f 66 20 |}..}.// | end of |
|00002390| 72 65 73 65 74 53 65 74 | 52 73 6c 0d 0d 0d 0d 0d |resetSet|Rsl.....|
|000023a0| 2f 2f 2d 2d 2d 2d 2d 2d | 20 73 65 74 4d 61 78 52 |//------| setMaxR|
|000023b0| 65 73 6f 6c 75 74 69 6f | 6e 20 2d 2d 2d 2d 2d 2d |esolutio|n ------|
|000023c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000023d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000023e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000023f0| 2d 2d 2d 2d 2d 0d 2f 2f | 0d 2f 2f 09 73 65 74 4d |-----.//|.//.setM|
|00002400| 61 78 52 65 73 6f 6c 75 | 74 69 6f 6e 20 77 69 6c |axResolu|tion wil|
|00002410| 6c 20 66 69 6e 64 20 74 | 68 65 20 68 69 67 68 65 |l find t|he highe|
|00002420| 73 74 20 22 73 71 75 61 | 72 65 22 20 72 65 73 6f |st "squa|re" reso|
|00002430| 6c 75 74 69 6f 6e 20 73 | 75 70 70 6f 72 74 65 64 |lution s|upported|
|00002440| 20 62 79 20 74 68 65 20 | 63 75 72 72 65 6e 74 6c | by the |currentl|
|00002450| 79 20 0d 2f 2f 09 73 65 | 6c 65 63 74 65 64 20 70 |y .//.se|lected p|
|00002460| 72 69 6e 74 65 72 20 64 | 72 69 76 65 72 20 61 6e |rinter d|river an|
|00002470| 64 20 73 65 74 20 74 68 | 65 20 50 72 69 6e 74 20 |d set th|e Print |
|00002480| 4d 61 6e 61 67 65 72 27 | 73 20 47 72 61 66 50 6f |Manager'|s GrafPo|
|00002490| 72 74 20 74 6f 20 74 68 | 69 73 20 72 65 73 6f 6c |rt to th|is resol|
|000024a0| 75 74 69 6f 6e 2e 20 0d | 2f 2f 09 54 68 69 73 20 |ution. .|//.This |
|000024b0| 77 69 6c 6c 20 65 6e 61 | 62 6c 65 20 68 69 67 68 |will ena|ble high|
|000024c0| 20 72 65 73 6f 6c 75 74 | 69 6f 6e 20 70 72 69 6e | resolut|ion prin|
|000024d0| 74 69 6e 67 20 75 73 69 | 6e 67 20 74 68 65 20 73 |ting usi|ng the s|
|000024e0| 74 61 6e 64 61 72 64 20 | 51 75 69 63 6b 64 72 61 |tandard |Quickdra|
|000024f0| 77 20 63 61 6c 6c 73 2e | 20 20 57 65 0d 2f 2f 09 |w calls.| We.//.|
|00002500| 77 69 6c 6c 20 72 65 74 | 75 72 6e 20 74 68 65 20 |will ret|urn the |
|00002510| 72 65 73 6f 6c 75 74 69 | 6f 6e 20 74 68 61 74 20 |resoluti|on that |
|00002520| 69 73 20 66 6f 75 6e 64 | 20 62 79 20 6f 75 72 20 |is found| by our |
|00002530| 63 61 6c 6c 73 20 74 6f | 20 47 65 74 52 73 6c 44 |calls to| GetRslD|
|00002540| 61 74 61 2e 20 20 49 66 | 20 74 68 65 20 0d 2f 2f |ata. If| the .//|
|00002550| 09 47 65 74 52 73 6c 44 | 61 74 61 20 61 6e 64 2f |.GetRslD|ata and/|
|00002560| 6f 72 20 53 65 74 52 73 | 6c 20 6f 70 63 6f 64 65 |or SetRs|l opcode|
|00002570| 73 20 61 72 65 20 6e 6f | 74 20 73 75 70 70 6f 72 |s are no|t suppor|
|00002580| 74 65 64 20 62 79 20 74 | 68 65 20 63 75 72 72 65 |ted by t|he curre|
|00002590| 6e 74 6c 79 20 73 65 6c | 65 63 74 65 64 20 70 72 |ntly sel|ected pr|
|000025a0| 69 6e 74 65 72 0d 2f 2f | 09 64 72 69 76 65 72 2c |inter.//|.driver,|
|000025b0| 20 77 65 20 77 69 6c 6c | 20 72 65 74 75 72 6e 20 | we will| return |
|000025c0| 30 2e 20 20 57 68 69 63 | 68 20 74 65 6c 6c 73 20 |0. Whic|h tells |
|000025d0| 74 68 65 20 63 61 6c 6c | 69 6e 67 20 66 75 6e 63 |the call|ing func|
|000025e0| 74 69 6f 6e 20 74 68 61 | 74 20 69 74 20 6d 75 73 |tion tha|t it mus|
|000025f0| 74 20 75 73 65 20 61 0d | 2f 2f 09 73 63 61 6c 65 |t use a.|//.scale|
|00002600| 20 66 61 63 74 6f 72 20 | 6f 66 20 31 20 61 6e 64 | factor |of 1 and|
|00002610| 20 61 73 73 75 6d 65 20 | 6e 6f 20 53 65 74 52 73 | assume |no SetRs|
|00002620| 6c 20 73 75 70 70 6f 72 | 74 0d 2f 2f 0d 0d 69 6e |l suppor|t.//..in|
|00002630| 74 20 73 65 74 4d 61 78 | 52 65 73 6f 6c 75 74 69 |t setMax|Resoluti|
|00002640| 6f 6e 20 28 29 0d 7b 0d | 20 09 69 6e 74 09 09 09 |on ().{.| .int...|
|00002650| 72 65 73 49 6e 64 65 78 | 3b 0d 20 09 0d 20 09 54 |resIndex|;. .. .T|
|00002660| 47 65 74 52 73 6c 42 6c | 6b 09 67 65 74 52 65 73 |GetRslBl|k.getRes|
|00002670| 52 65 63 3b 0d 20 09 54 | 53 65 74 52 73 6c 42 6c |Rec;. .T|SetRslBl|
|00002680| 6b 09 73 65 74 52 65 73 | 52 65 63 3b 0d 0d 09 2f |k.setRes|Rec;.../|
|00002690| 2f 09 53 61 76 65 20 74 | 68 65 20 63 75 72 72 65 |/.Save t|he curre|
|000026a0| 6e 74 20 72 65 73 6f 6c | 75 74 69 6f 6e 20 76 61 |nt resol|ution va|
|000026b0| 6c 75 65 73 20 66 72 6f | 6d 20 74 68 65 20 69 56 |lues fro|m the iV|
|000026c0| 52 65 73 20 61 6e 64 20 | 69 48 72 65 73 20 66 69 |Res and |iHres fi|
|000026d0| 65 6c 64 73 20 66 72 6f | 6d 20 0d 09 2f 2f 20 20 |elds fro|m ..// |
|000026e0| 74 68 65 20 50 72 4a 6f | 62 20 72 65 63 6f 72 64 |the PrJo|b record|
|000026f0| 3b 20 77 68 69 63 68 20 | 65 6e 61 62 6c 65 73 20 |; which |enables |
|00002700| 75 73 20 74 6f 20 72 65 | 73 65 74 20 74 68 65 20 |us to re|set the |
|00002710| 70 72 69 6e 74 20 68 61 | 6e 64 6c 65 20 77 69 74 |print ha|ndle wit|
|00002720| 68 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 0d |h the or|iginal .|
|00002730| 09 2f 2f 20 20 76 61 6c | 75 65 73 2c 20 69 66 20 |.// val|ues, if |
|00002740| 74 68 65 20 75 73 65 72 | 20 75 6e 2d 63 68 65 63 |the user| un-chec|
|00002750| 6b 73 20 74 68 65 20 22 | 68 69 67 68 20 72 65 73 |ks the "|high res|
|00002760| 6f 6c 75 74 69 6f 6e 22 | 20 6d 65 6e 75 20 69 74 |olution"| menu it|
|00002770| 65 6d 2e 0d 09 0d 09 73 | 61 76 65 52 65 73 6f 6c |em.....s|aveResol|
|00002780| 75 74 69 6f 6e 20 28 29 | 3b 20 20 20 0d 0d 20 09 |ution ()|; .. .|
|00002790| 67 65 74 52 65 73 52 65 | 63 2e 69 4f 70 43 6f 64 |getResRe|c.iOpCod|
|000027a0| 65 20 3d 20 67 65 74 52 | 73 6c 44 61 74 61 4f 70 |e = getR|slDataOp|
|000027b0| 3b 0d 20 09 50 72 47 65 | 6e 65 72 61 6c 20 28 28 |;. .PrGe|neral ((|
|000027c0| 50 74 72 29 28 26 67 65 | 74 52 65 73 52 65 63 29 |Ptr)(&ge|tResRec)|
|000027d0| 29 3b 09 0d 20 09 0d 20 | 09 2f 2f 09 57 65 20 68 |);.. .. |.//.We h|
|000027e0| 61 76 65 20 61 6e 20 61 | 72 72 61 79 20 6f 66 20 |ave an a|rray of |
|000027f0| 70 6f 73 73 69 62 6c 65 | 20 72 65 73 6f 6c 75 74 |possible| resolut|
|00002800| 69 6f 6e 73 2e 0d 09 2f | 2f 20 20 41 66 74 65 72 |ions.../|/ After|
|00002810| 20 63 68 65 63 6b 69 6e | 67 20 66 6f 72 20 65 72 | checkin|g for er|
|00002820| 72 6f 72 73 2c 20 77 65 | 20 6c 6f 6f 70 20 74 68 |rors, we| loop th|
|00002830| 72 6f 75 67 68 20 65 61 | 63 68 20 72 65 73 6f 6c |rough ea|ch resol|
|00002840| 75 74 69 6f 6e 20 0d 20 | 09 2f 2f 09 72 61 6e 67 |ution . |.//.rang|
|00002850| 65 20 72 65 63 6f 72 64 | 20 6c 6f 6f 6b 69 6e 67 |e record| looking|
|00002860| 20 66 6f 72 20 74 68 65 | 20 68 69 67 68 65 73 74 | for the| highest|
|00002870| 20 72 65 73 6f 6c 75 74 | 69 6f 6e 20 61 76 61 69 | resolut|ion avai|
|00002880| 6c 61 62 6c 65 2c 20 77 | 68 65 72 65 20 78 20 61 |lable, w|here x a|
|00002890| 6e 64 0d 20 09 2f 2f 09 | 79 20 61 72 65 20 65 71 |nd. .//.|y are eq|
|000028a0| 75 61 6c 2e 20 54 68 69 | 73 20 6c 6f 6f 70 20 6d |ual. Thi|s loop m|
|000028b0| 61 6b 65 73 20 6e 6f 20 | 61 73 73 75 6d 70 74 69 |akes no |assumpti|
|000028c0| 6f 6e 73 20 61 62 6f 75 | 74 20 74 68 65 20 6f 72 |ons abou|t the or|
|000028d0| 64 65 72 20 6f 66 20 74 | 68 65 20 0d 20 09 2f 2f |der of t|he . .//|
|000028e0| 09 72 65 73 6f 6c 75 74 | 69 6f 6e 20 72 65 63 6f |.resolut|ion reco|
|000028f0| 72 64 73 2e 20 46 69 6e | 64 20 74 68 65 20 6d 61 |rds. Fin|d the ma|
|00002900| 78 69 6d 75 6d 20 72 65 | 73 6f 6c 75 74 69 6f 6e |ximum re|solution|
|00002910| 20 73 75 70 70 6f 72 74 | 65 64 20 62 79 20 74 68 | support|ed by th|
|00002920| 65 20 63 75 72 72 65 6e | 74 20 73 65 6c 65 63 74 |e curren|t select|
|00002930| 65 64 20 64 65 76 69 63 | 65 2e 0d 20 09 2f 2f 09 |ed devic|e.. .//.|
|00002940| 53 6f 6d 65 20 64 65 76 | 69 63 65 73 20 73 75 70 |Some dev|ices sup|
|00002950| 70 6f 72 74 20 6e 6f 6e | 2d 73 71 75 61 72 65 20 |port non|-square |
|00002960| 61 73 70 65 63 74 20 72 | 61 74 69 6f 73 20 28 69 |aspect r|atios (i|
|00002970| 2e 65 2e 20 78 2d 72 65 | 73 20 21 3d 20 79 2d 72 |.e. x-re|s != y-r|
|00002980| 65 73 29 2c 20 77 65 0d | 20 09 2f 2f 09 6e 65 65 |es), we.| .//.nee|
|00002990| 64 20 74 6f 20 66 69 6e | 64 20 74 68 65 20 6c 61 |d to fin|d the la|
|000029a0| 72 67 65 73 74 20 22 73 | 71 75 61 72 65 22 20 72 |rgest "s|quare" r|
|000029b0| 65 73 6f 6c 75 74 69 6f | 6e 20 73 75 70 70 6f 72 |esolutio|n suppor|
|000029c0| 74 65 64 2e 20 20 54 68 | 65 20 6c 61 73 74 20 72 |ted. Th|e last r|
|000029d0| 67 52 73 6c 52 65 63 20 | 69 73 0d 09 2f 2f 20 20 |gRslRec |is..// |
|000029e0| 74 68 65 20 22 68 69 67 | 68 65 73 74 22 20 73 75 |the "hig|hest" su|
|000029f0| 70 70 6f 72 74 65 64 20 | 72 65 73 6f 6c 75 74 69 |pported |resoluti|
|00002a00| 6f 6e 20 72 65 63 6f 72 | 64 20 66 6f 72 20 61 6c |on recor|d for al|
|00002a10| 6c 20 6f 66 20 74 68 65 | 20 41 70 70 6c 65 20 70 |l of the| Apple p|
|00002a20| 72 69 6e 74 65 72 20 64 | 72 69 76 65 72 73 2e 0d |rinter d|rivers..|
|00002a30| 09 0d 20 09 69 66 20 28 | 67 65 74 52 65 73 52 65 |.. .if (|getResRe|
|00002a40| 63 2e 69 45 72 72 6f 72 | 20 3d 3d 20 6e 6f 45 72 |c.iError| == noEr|
|00002a50| 72 20 26 26 20 50 72 45 | 72 72 6f 72 28 29 20 3d |r && PrE|rror() =|
|00002a60| 3d 20 6e 6f 45 72 72 29 | 0d 20 09 20 20 7b 0d 20 |= noErr)|. . {. |
|00002a70| 09 20 20 20 66 6f 72 20 | 28 72 65 73 49 6e 64 65 |. for |(resInde|
|00002a80| 78 20 3d 20 30 3b 20 72 | 65 73 49 6e 64 65 78 20 |x = 0; r|esIndex |
|00002a90| 3c 20 67 65 74 52 65 73 | 52 65 63 2e 69 52 73 6c |< getRes|Rec.iRsl|
|00002aa0| 52 65 63 43 6e 74 20 3b | 20 72 65 73 49 6e 64 65 |RecCnt ;| resInde|
|00002ab0| 78 2b 2b 29 0d 20 09 20 | 20 20 20 20 20 7b 0d 20 |x++). . | {. |
|00002ac0| 09 20 20 20 20 20 20 20 | 20 69 66 20 28 20 67 65 |. | if ( ge|
|00002ad0| 74 52 65 73 52 65 63 2e | 72 67 52 73 6c 52 65 63 |tResRec.|rgRslRec|
|00002ae0| 5b 72 65 73 49 6e 64 65 | 78 5d 2e 69 58 52 73 6c |[resInde|x].iXRsl|
|00002af0| 20 3d 3d 0d 20 09 20 20 | 20 20 20 20 20 20 20 20 | ==. . | |
|00002b00| 20 20 20 20 67 65 74 52 | 65 73 52 65 63 2e 72 67 | getR|esRec.rg|
|00002b10| 52 73 6c 52 65 63 5b 72 | 65 73 49 6e 64 65 78 5d |RslRec[r|esIndex]|
|00002b20| 2e 69 59 52 73 6c 20 26 | 26 20 0d 20 09 20 20 20 |.iYRsl &|& . . |
|00002b30| 20 20 20 20 20 20 20 20 | 20 20 20 67 65 74 52 65 | | getRe|
|00002b40| 73 52 65 63 2e 72 67 52 | 73 6c 52 65 63 5b 72 65 |sRec.rgR|slRec[re|
|00002b50| 73 49 6e 64 65 78 5d 2e | 69 58 52 73 6c 20 3e 20 |sIndex].|iXRsl > |
|00002b60| 67 4d 61 78 44 50 49 29 | 0d 09 20 20 20 20 20 20 |gMaxDPI)|.. |
|00002b70| 20 20 20 20 20 20 20 20 | 0d 09 09 09 20 20 20 67 | |.... g|
|00002b80| 4d 61 78 44 50 49 20 3d | 20 67 65 74 52 65 73 52 |MaxDPI =| getResR|
|00002b90| 65 63 2e 72 67 52 73 6c | 52 65 63 5b 72 65 73 49 |ec.rgRsl|Rec[resI|
|00002ba0| 6e 64 65 78 5d 2e 69 59 | 52 73 6c 3b 0d 20 20 09 |ndex].iY|Rsl;. .|
|00002bb0| 20 20 20 20 20 20 7d 0d | 09 09 20 20 20 0d 20 09 | }.|.. . .|
|00002bc0| 20 20 20 2f 2f 20 20 57 | 65 20 6e 6f 77 20 68 61 | // W|e now ha|
|00002bd0| 76 65 20 74 68 65 20 64 | 65 73 69 72 65 64 20 72 |ve the d|esired r|
|00002be0| 65 73 6f 6c 75 74 69 6f | 6e 2e 20 49 66 20 69 74 |esolutio|n. If it|
|00002bf0| 20 69 73 20 6e 6f 74 20 | 30 2c 20 74 68 65 6e 20 | is not |0, then |
|00002c00| 77 65 0d 09 20 20 20 2f | 2f 20 20 75 73 65 20 74 |we.. /|/ use t|
|00002c10| 68 65 20 53 65 74 52 73 | 6c 20 6f 70 63 6f 64 65 |he SetRs|l opcode|
|00002c20| 20 74 6f 20 73 65 74 20 | 74 68 65 20 72 65 73 6f | to set |the reso|
|00002c30| 6c 75 74 69 6f 6e 2e 0d | 0d 20 20 20 20 20 20 20 |lution..|. |
|00002c40| 69 66 20 28 67 4d 61 78 | 44 50 49 20 21 3d 20 30 |if (gMax|DPI != 0|
|00002c50| 20 26 26 20 67 50 72 52 | 65 63 48 64 6c 20 21 3d | && gPrR|ecHdl !=|
|00002c60| 20 6e 69 6c 29 0d 09 20 | 20 09 20 7b 0d 20 20 20 | nil).. | . {. |
|00002c70| 20 09 09 73 65 74 52 65 | 73 52 65 63 2e 69 4f 70 | ..setRe|sRec.iOp|
|00002c80| 43 6f 64 65 20 3d 20 73 | 65 74 52 73 6c 4f 70 3b |Code = s|etRslOp;|
|00002c90| 0d 20 20 20 20 09 09 73 | 65 74 52 65 73 52 65 63 |. ..s|etResRec|
|00002ca0| 2e 68 50 72 69 6e 74 20 | 3d 20 67 50 72 52 65 63 |.hPrint |= gPrRec|
|00002cb0| 48 64 6c 3b 0d 0d 20 20 | 20 20 09 09 73 65 74 52 |Hdl;.. | ..setR|
|00002cc0| 65 73 52 65 63 2e 69 58 | 52 73 6c 20 3d 20 67 4d |esRec.iX|Rsl = gM|
|00002cd0| 61 78 44 50 49 3b 0d 20 | 20 20 20 09 09 73 65 74 |axDPI;. | ..set|
|00002ce0| 52 65 73 52 65 63 2e 69 | 59 52 73 6c 20 3d 20 67 |ResRec.i|YRsl = g|
|00002cf0| 4d 61 78 44 50 49 3b 0d | 20 20 20 20 20 20 20 20 |MaxDPI;.| |
|00002d00| 20 0d 20 09 09 09 50 72 | 47 65 6e 65 72 61 6c 20 | . ...Pr|General |
|00002d10| 28 28 50 74 72 29 28 26 | 73 65 74 52 65 73 52 65 |((Ptr)(&|setResRe|
|00002d20| 63 29 29 3b 09 0d 09 20 | 20 09 20 7d 0d 09 20 20 |c));... | . }.. |
|00002d30| 7d 0d 09 20 2f 2f 09 20 | 49 66 20 74 68 65 20 63 |}.. //. |If the c|
|00002d40| 75 72 72 65 6e 74 20 70 | 72 69 6e 74 65 72 20 64 |urrent p|rinter d|
|00002d50| 72 69 76 65 72 20 64 6f | 65 73 20 4e 4f 54 20 73 |river do|es NOT s|
|00002d60| 75 70 70 6f 72 74 20 47 | 65 74 52 73 6c 44 61 74 |upport G|etRslDat|
|00002d70| 61 20 73 65 74 20 74 68 | 65 20 66 6c 61 67 0d 09 |a set th|e flag..|
|00002d80| 20 2f 2f 20 20 61 6e 64 | 20 72 65 74 75 72 6e 20 | // and| return |
|00002d90| 30 2c 20 77 68 69 63 68 | 20 74 65 6c 6c 73 20 74 |0, which| tells t|
|00002da0| 68 65 20 63 61 6c 6c 69 | 6e 67 20 66 75 6e 63 74 |he calli|ng funct|
|00002db0| 69 6f 6e 20 74 6f 20 75 | 73 65 20 61 20 73 63 61 |ion to u|se a sca|
|00002dc0| 6c 65 20 66 61 63 74 6f | 72 20 6f 66 20 31 2e 0d |le facto|r of 1..|
|00002dd0| 20 09 0d 09 20 65 6c 73 | 65 20 69 66 20 28 67 65 | ... els|e if (ge|
|00002de0| 74 52 65 73 52 65 63 2e | 69 45 72 72 6f 72 20 3d |tResRec.|iError =|
|00002df0| 3d 20 4f 70 4e 6f 74 49 | 6d 70 6c 29 20 20 20 0d |= OpNotI|mpl) .|
|00002e00| 09 20 20 20 20 20 20 20 | 7b 0d 09 09 20 20 20 20 |. |{... |
|00002e10| 20 67 53 65 74 52 73 6c | 4f 70 49 6d 70 6c 20 3d | gSetRsl|OpImpl =|
|00002e20| 20 66 61 6c 73 65 3b 0d | 09 09 20 20 20 20 20 72 | false;.|.. r|
|00002e30| 65 74 75 72 6e 20 28 30 | 29 3b 0d 09 09 20 20 20 |eturn (0|);... |
|00002e40| 7d 0d 20 20 20 20 20 20 | 20 20 20 20 65 6c 73 65 |}. | else|
|00002e50| 20 41 6c 65 72 74 55 73 | 65 72 20 28 29 3b 20 0d | AlertUs|er (); .|
|00002e60| 0d 0d 20 09 2f 2f 09 49 | 66 20 6f 75 72 20 63 61 |.. .//.I|f our ca|
|00002e70| 6c 6c 20 74 6f 20 53 65 | 74 52 73 6c 20 77 6f 72 |ll to Se|tRsl wor|
|00002e80| 6b 65 64 20 72 65 74 75 | 72 6e 20 74 68 65 20 22 |ked retu|rn the "|
|00002e90| 6e 65 77 22 20 72 65 73 | 6f 6c 75 74 69 6f 6e 2c |new" res|olution,|
|00002ea0| 20 6f 74 68 65 72 77 69 | 73 65 0d 09 2f 2f 09 63 | otherwi|se..//.c|
|00002eb0| 68 65 63 6b 20 74 6f 20 | 73 65 65 20 69 66 20 74 |heck to |see if t|
|00002ec0| 68 69 73 20 6f 70 63 6f | 64 65 20 69 73 20 69 6d |his opco|de is im|
|00002ed0| 70 6c 65 6d 65 6e 74 65 | 64 2e 20 20 49 66 20 69 |plemente|d. If i|
|00002ee0| 74 20 69 73 20 6e 6f 74 | 20 72 65 74 75 72 6e 20 |t is not| return |
|00002ef0| 30 20 0d 09 2f 2f 09 61 | 6e 64 20 73 65 74 20 6f |0 ..//.a|nd set o|
|00002f00| 75 72 20 53 65 74 52 73 | 6c 4f 70 49 6d 70 6c 20 |ur SetRs|lOpImpl |
|00002f10| 66 6c 61 67 20 74 6f 20 | 66 61 6c 73 65 2e 20 20 |flag to |false. |
|00002f20| 0d 09 0d 09 69 66 20 28 | 73 65 74 52 65 73 52 65 |....if (|setResRe|
|00002f30| 63 2e 69 45 72 72 6f 72 | 20 3d 3d 20 6e 6f 45 72 |c.iError| == noEr|
|00002f40| 72 20 26 26 20 50 72 45 | 72 72 6f 72 28 29 20 3d |r && PrE|rror() =|
|00002f50| 3d 20 6e 6f 45 72 72 20 | 26 26 20 67 4d 61 78 44 |= noErr |&& gMaxD|
|00002f60| 50 49 20 21 3d 20 30 29 | 0d 09 20 20 09 72 65 74 |PI != 0)|.. .ret|
|00002f70| 75 72 6e 20 28 67 4d 61 | 78 44 50 49 29 3b 0d 09 |urn (gMa|xDPI);..|
|00002f80| 65 6c 73 65 20 69 66 20 | 28 73 65 74 52 65 73 52 |else if |(setResR|
|00002f90| 65 63 2e 69 45 72 72 6f | 72 20 3d 3d 20 4f 70 4e |ec.iErro|r == OpN|
|00002fa0| 6f 74 49 6d 70 6c 20 26 | 26 20 50 72 45 72 72 6f |otImpl &|& PrErro|
|00002fb0| 72 28 29 20 3d 3d 20 6e | 6f 45 72 72 29 0d 09 20 |r() == n|oErr).. |
|00002fc0| 20 20 20 20 20 20 7b 0d | 09 20 20 20 20 20 20 20 | {.|. |
|00002fd0| 20 20 67 53 65 74 52 73 | 6c 4f 70 49 6d 70 6c 20 | gSetRs|lOpImpl |
|00002fe0| 3d 20 66 61 6c 73 65 3b | 0d 09 09 20 20 20 20 20 |= false;|... |
|00002ff0| 72 65 74 75 72 6e 20 28 | 30 29 3b 0d 09 09 20 20 |return (|0);... |
|00003000| 20 7d 0d 09 09 20 65 6c | 73 65 20 72 65 74 75 72 | }... el|se retur|
|00003010| 6e 20 28 30 29 3b 0d 0d | 7d 20 20 20 20 2f 2f 20 |n (0);..|} // |
|00003020| 20 65 6e 64 20 6f 66 20 | 73 65 74 4d 61 78 52 65 | end of |setMaxRe|
|00003030| 73 6f 6c 75 74 69 6f 6e | 0d 0d 0d 0d 09 0d 2f 2f |solution|......//|
|00003040| 2d 2d 2d 2d 2d 2d 20 64 | 6f 53 65 74 52 73 6c 20 |------ d|oSetRsl |
|00003050| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003060| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003070| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003080| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003090| 2d 2d 2d 0d 2f 2f 0d 2f | 2f 20 20 64 6f 53 65 74 |---.//./|/ doSet|
|000030a0| 52 73 6c 20 69 73 20 74 | 68 65 20 63 61 6c 6c 69 |Rsl is t|he calli|
|000030b0| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 20 74 68 61 74 |ng funct|ion that|
|000030c0| 20 63 61 6c 6c 73 20 73 | 65 74 4d 61 78 52 65 73 | calls s|etMaxRes|
|000030d0| 6f 6c 75 74 69 6f 6e 2e | 20 20 73 65 74 4d 61 78 |olution.| setMax|
|000030e0| 52 65 73 6f 6c 75 74 69 | 6f 6e 0d 2f 2f 09 77 69 |Resoluti|on.//.wi|
|000030f0| 6c 6c 20 72 65 74 75 72 | 6e 20 74 68 65 20 6d 61 |ll retur|n the ma|
|00003100| 78 69 6d 75 6d 20 72 65 | 73 6f 6c 75 74 69 6f 6e |ximum re|solution|
|00003110| 20 74 68 61 74 20 69 73 | 20 73 75 70 70 6f 72 74 | that is| support|
|00003120| 65 64 20 62 79 20 74 68 | 65 20 63 75 72 72 65 6e |ed by th|e curren|
|00003130| 74 20 70 72 69 6e 74 65 | 72 0d 2f 2f 09 64 72 69 |t printe|r.//.dri|
|00003140| 76 65 72 2e 20 20 57 69 | 74 68 20 74 68 69 73 20 |ver. Wi|th this |
|00003150| 64 65 76 69 63 65 20 72 | 65 73 6f 6c 75 74 69 6f |device r|esolutio|
|00003160| 6e 20 28 64 65 76 69 63 | 65 52 65 73 29 2c 20 77 |n (devic|eRes), w|
|00003170| 65 20 77 69 6c 6c 20 74 | 68 65 6e 20 64 65 74 65 |e will t|hen dete|
|00003180| 72 6d 69 6e 65 20 74 68 | 65 20 73 63 61 6c 65 0d |rmine th|e scale.|
|00003190| 2f 2f 09 66 61 63 74 6f | 72 20 74 68 61 74 20 6d |//.facto|r that m|
|000031a0| 75 73 74 20 62 65 20 75 | 73 65 64 20 6f 6e 20 61 |ust be u|sed on a|
|000031b0| 6c 6c 20 6f 66 20 6f 75 | 72 20 63 6f 6f 72 64 69 |ll of ou|r coordi|
|000031c0| 6e 61 74 65 73 20 61 6e | 64 20 66 6f 6e 74 20 73 |nates an|d font s|
|000031d0| 69 7a 65 73 2c 20 6f 74 | 68 65 72 77 69 73 65 0d |izes, ot|herwise.|
|000031e0| 2f 2f 09 77 65 20 77 69 | 6c 6c 20 72 65 63 65 69 |//.we wi|ll recei|
|000031f0| 76 65 20 22 6d 69 63 72 | 6f 22 20 74 65 78 74 20 |ve "micr|o" text |
|00003200| 61 6e 64 20 69 6d 61 67 | 65 73 2e 20 20 49 66 20 |and imag|es. If |
|00003210| 73 65 74 4d 61 78 72 65 | 73 6f 6c 75 74 69 6f 6e |setMaxre|solution|
|00003220| 20 72 65 74 75 72 6e 73 | 20 30 2c 20 69 74 20 6d | returns| 0, it m|
|00003230| 65 61 6e 73 20 0d 2f 2f | 09 74 68 61 74 20 53 65 |eans .//|.that Se|
|00003240| 74 52 73 6c 20 61 6e 64 | 20 47 65 74 52 73 6c 44 |tRsl and| GetRslD|
|00003250| 61 74 61 20 61 72 65 20 | 6e 6f 74 20 73 75 70 70 |ata are |not supp|
|00003260| 6f 72 74 65 64 20 6f 72 | 20 61 6e 20 65 72 72 6f |orted or| an erro|
|00003270| 72 20 6f 63 63 75 72 72 | 65 64 2e 20 20 57 65 20 |r occurr|ed. We |
|00003280| 77 69 6c 6c 20 74 68 65 | 6e 0d 2f 2f 09 75 73 65 |will the|n.//.use|
|00003290| 20 61 20 73 63 61 6c 65 | 20 66 61 63 74 6f 72 20 | a scale| factor |
|000032a0| 6f 66 20 31 2e 0d 2f 2f | 0d 0d 76 6f 69 64 20 64 |of 1..//|..void d|
|000032b0| 6f 53 65 74 52 73 6c 20 | 28 29 0d 7b 0d 09 73 68 |oSetRsl |().{..sh|
|000032c0| 6f 72 74 09 09 64 65 76 | 69 63 65 52 65 73 3b 0d |ort..dev|iceRes;.|
|000032d0| 09 47 72 61 66 50 74 72 | 09 09 6f 6c 64 50 6f 72 |.GrafPtr|..oldPor|
|000032e0| 74 3b 0d 09 0d 09 47 65 | 74 50 6f 72 74 20 28 26 |t;....Ge|tPort (&|
|000032f0| 6f 6c 64 50 6f 72 74 29 | 3b 0d 0d 09 64 65 76 69 |oldPort)|;...devi|
|00003300| 63 65 52 65 73 20 3d 20 | 73 65 74 4d 61 78 52 65 |ceRes = |setMaxRe|
|00003310| 73 6f 6c 75 74 69 6f 6e | 20 28 29 3b 0d 20 20 20 |solution| ();. |
|00003320| 20 20 0d 09 2f 2f 09 49 | 66 20 64 65 76 69 63 65 | ..//.I|f device|
|00003330| 52 65 73 20 69 73 20 6e | 6f 74 20 7a 65 72 6f 2c |Res is n|ot zero,|
|00003340| 20 77 65 20 77 69 6c 6c | 20 64 65 74 65 72 6d 69 | we will| determi|
|00003350| 6e 65 20 74 68 65 20 73 | 63 61 6c 65 20 66 61 63 |ne the s|cale fac|
|00003360| 74 6f 72 20 74 68 61 74 | 0d 09 2f 2f 09 4d 55 53 |tor that|..//.MUS|
|00003370| 54 20 62 65 20 75 73 65 | 64 20 6f 6e 20 61 6c 6c |T be use|d on all|
|00003380| 20 6f 66 20 6f 75 72 20 | 63 6f 6f 72 64 69 6e 61 | of our |coordina|
|00003390| 74 65 73 20 61 6e 64 20 | 66 6f 6e 74 20 73 69 7a |tes and |font siz|
|000033a0| 65 73 2e 20 20 49 66 20 | 77 65 20 64 6f 20 0d 09 |es. If |we do ..|
|000033b0| 2f 2f 09 4e 4f 54 20 73 | 63 61 6c 65 20 74 68 65 |//.NOT s|cale the|
|000033c0| 73 65 20 69 74 65 6d 73 | 2c 20 77 65 20 77 69 6c |se items|, we wil|
|000033d0| 6c 20 67 65 74 20 74 68 | 65 20 22 6d 69 63 72 6f |l get th|e "micro|
|000033e0| 22 20 74 65 78 74 20 61 | 6e 64 20 69 6d 61 67 65 |" text a|nd image|
|000033f0| 73 2e 2e 2e 0d 09 0d 20 | 20 20 20 69 66 20 28 64 |s...... | if (d|
|00003400| 65 76 69 63 65 52 65 73 | 20 21 3d 20 30 29 20 67 |eviceRes| != 0) g|
|00003410| 53 63 61 6c 65 20 3d 20 | 64 65 76 69 63 65 52 65 |Scale = |deviceRe|
|00003420| 73 20 2f 20 4d 61 63 53 | 63 72 65 65 6e 52 65 73 |s / MacS|creenRes|
|00003430| 3b 0d 0d 09 53 65 74 50 | 6f 72 74 20 28 6f 6c 64 |;...SetP|ort (old|
|00003440| 50 6f 72 74 29 3b 0d 0d | 7d 09 2f 2f 09 20 65 6e |Port);..|}.//. en|
|00003450| 64 20 6f 66 20 64 6f 53 | 65 74 52 73 6c 0d 0d 0d |d of doS|etRsl...|
|00003460| 0d 0d 2f 2f 2d 2d 2d 2d | 2d 2d 20 64 6f 44 72 61 |..//----|-- doDra|
|00003470| 66 74 42 69 74 73 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ftBits -|--------|
|00003480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003490| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000034a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000034b0| 2d 2d 2d 2d 2d 2d 2d 0d | 2f 2f 0d 2f 2f 09 64 6f |-------.|//.//.do|
|000034c0| 44 72 61 66 74 42 69 74 | 73 20 77 69 6c 6c 20 73 |DraftBit|s will s|
|000034d0| 65 74 20 74 68 65 20 64 | 72 61 66 74 42 69 74 73 |et the d|raftBits|
|000034e0| 4f 70 20 6f 70 63 6f 64 | 65 20 66 6f 72 20 74 68 |Op opcod|e for th|
|000034f0| 65 20 63 75 72 72 65 6e | 74 20 70 72 69 6e 74 65 |e curren|t printe|
|00003500| 72 20 64 72 69 76 65 72 | 2e 20 20 49 66 20 74 68 |r driver|. If th|
|00003510| 65 20 0d 2f 2f 09 63 75 | 72 72 65 6e 74 20 70 72 |e .//.cu|rrent pr|
|00003520| 69 6e 74 65 72 20 64 72 | 69 76 65 72 20 64 6f 65 |inter dr|iver doe|
|00003530| 73 20 4e 4f 54 20 73 75 | 70 70 6f 72 74 20 74 68 |s NOT su|pport th|
|00003540| 69 73 20 6f 70 63 6f 64 | 65 2c 20 77 65 20 77 69 |is opcod|e, we wi|
|00003550| 6c 6c 20 73 65 74 20 74 | 68 65 20 67 44 72 61 66 |ll set t|he gDraf|
|00003560| 74 42 69 74 73 4f 70 49 | 6d 70 6c 0d 2f 2f 09 66 |tBitsOpI|mpl.//.f|
|00003570| 6c 61 67 20 74 6f 20 66 | 61 6c 73 65 20 77 68 69 |lag to f|alse whi|
|00003580| 63 68 20 77 69 6c 6c 20 | 70 72 65 76 65 6e 74 20 |ch will |prevent |
|00003590| 74 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 66 72 |this fun|ction fr|
|000035a0| 6f 6d 20 62 65 69 6e 67 | 20 63 61 6c 6c 65 64 2e |om being| called.|
|000035b0| 20 20 49 66 20 61 6e 79 | 20 65 72 72 6f 72 20 6f | If any| error o|
|000035c0| 63 63 75 72 73 2c 0d 2f | 2f 09 77 65 20 77 69 6c |ccurs,./|/.we wil|
|000035d0| 6c 20 61 6c 65 72 74 20 | 74 68 65 20 75 73 65 72 |l alert |the user|
|000035e0| 20 76 69 61 20 74 68 65 | 20 41 6c 65 72 74 55 73 | via the| AlertUs|
|000035f0| 65 72 20 66 75 6e 63 74 | 69 6f 6e 2e 0d 2f 2f 0d |er funct|ion..//.|
|00003600| 0d 76 6f 69 64 20 64 6f | 44 72 61 66 74 42 69 74 |.void do|DraftBit|
|00003610| 73 20 28 29 0d 7b 0d 09 | 54 44 66 74 42 69 74 73 |s ().{..|TDftBits|
|00003620| 42 6c 6b 09 09 64 72 61 | 66 74 42 69 74 73 42 6c |Blk..dra|ftBitsBl|
|00003630| 6b 3b 0d 0d 09 67 44 72 | 61 66 74 42 69 74 73 48 |k;...gDr|aftBitsH|
|00003640| 61 73 42 65 65 6e 53 65 | 74 20 3d 20 74 72 75 65 |asBeenSe|t = true|
|00003650| 3b 0d 0d 20 20 20 20 2f | 2f 20 20 53 65 74 20 74 |;.. /|/ Set t|
|00003660| 68 65 20 64 72 61 66 74 | 42 69 74 73 4f 70 20 61 |he draft|BitsOp a|
|00003670| 6e 64 20 75 70 64 61 74 | 65 20 74 68 65 20 63 6f |nd updat|e the co|
|00003680| 6e 74 65 6e 74 73 20 6f | 66 20 74 68 65 20 70 72 |ntents o|f the pr|
|00003690| 69 6e 74 20 68 61 6e 64 | 6c 65 2e 0d 09 0d 09 64 |int hand|le.....d|
|000036a0| 72 61 66 74 42 69 74 73 | 42 6c 6b 2e 69 4f 70 43 |raftBits|Blk.iOpC|
|000036b0| 6f 64 65 20 3d 20 64 72 | 61 66 74 42 69 74 73 4f |ode = dr|aftBitsO|
|000036c0| 70 3b 0d 09 64 72 61 66 | 74 42 69 74 73 42 6c 6b |p;..draf|tBitsBlk|
|000036d0| 2e 68 50 72 69 6e 74 20 | 3d 20 67 50 72 52 65 63 |.hPrint |= gPrRec|
|000036e0| 48 64 6c 3b 0d 09 50 72 | 47 65 6e 65 72 61 6c 28 |Hdl;..Pr|General(|
|000036f0| 28 50 74 72 29 20 26 64 | 72 61 66 74 42 69 74 73 |(Ptr) &d|raftBits|
|00003700| 42 6c 6b 29 3b 0d 0d 09 | 2f 2f 20 20 54 68 65 20 |Blk);...|// The |
|00003710| 64 72 61 66 74 42 69 74 | 73 20 6f 70 63 6f 64 65 |draftBit|s opcode|
|00003720| 20 69 73 20 4e 4f 54 20 | 73 75 70 70 6f 72 74 65 | is NOT |supporte|
|00003730| 64 20 62 79 20 74 68 65 | 20 63 75 72 72 65 6e 74 |d by the| current|
|00003740| 20 70 72 69 6e 74 65 72 | 20 64 72 69 76 65 72 2c | printer| driver,|
|00003750| 0d 09 2f 2f 20 20 74 68 | 65 72 65 66 6f 72 65 20 |..// th|erefore |
|00003760| 77 65 20 77 69 6c 6c 20 | 73 65 74 20 74 68 65 20 |we will |set the |
|00003770| 64 72 61 66 74 42 69 74 | 73 20 6f 70 63 6f 64 65 |draftBit|s opcode|
|00003780| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 66 6c 61 | impleme|nted fla|
|00003790| 67 20 74 6f 20 66 61 6c | 73 65 2e 0d 09 2f 2f 20 |g to fal|se...// |
|000037a0| 20 57 68 69 63 68 20 77 | 69 6c 6c 20 70 72 65 76 | Which w|ill prev|
|000037b0| 65 6e 74 20 74 68 69 73 | 20 66 75 6e 63 74 69 6f |ent this| functio|
|000037c0| 6e 20 66 72 6f 6d 20 62 | 65 69 6e 67 20 63 61 6c |n from b|eing cal|
|000037d0| 6c 65 64 20 75 6e 74 69 | 6c 20 61 20 6e 65 77 20 |led unti|l a new |
|000037e0| 70 72 69 6e 74 65 72 20 | 0d 09 2f 2f 20 20 69 73 |printer |..// is|
|000037f0| 20 73 65 6c 65 63 74 65 | 64 20 76 69 61 20 74 68 | selecte|d via th|
|00003800| 65 20 43 68 6f 6f 73 65 | 72 2e 20 20 49 66 20 61 |e Choose|r. If a|
|00003810| 6e 6f 74 68 65 72 20 74 | 79 70 65 20 6f 66 20 65 |nother t|ype of e|
|00003820| 72 72 6f 72 20 6f 63 63 | 75 72 72 65 64 20 72 65 |rror occ|urred re|
|00003830| 70 6f 72 74 0d 09 2f 2f | 20 20 69 74 20 74 6f 20 |port..//| it to |
|00003840| 74 68 65 20 75 73 65 72 | 20 76 69 61 20 41 6c 65 |the user| via Ale|
|00003850| 72 74 55 73 65 72 2e 0d | 0d 09 69 66 20 28 64 72 |rtUser..|..if (dr|
|00003860| 61 66 74 42 69 74 73 42 | 6c 6b 2e 69 45 72 72 6f |aftBitsB|lk.iErro|
|00003870| 72 20 3d 3d 20 4f 70 4e | 6f 74 49 6d 70 6c 20 26 |r == OpN|otImpl &|
|00003880| 26 20 50 72 45 72 72 6f | 72 28 29 20 3d 3d 20 6e |& PrErro|r() == n|
|00003890| 6f 45 72 72 29 0d 09 20 | 20 67 44 72 61 66 74 42 |oErr).. | gDraftB|
|000038a0| 69 74 73 4f 70 49 6d 70 | 6c 20 20 3d 20 66 61 6c |itsOpImp|l = fal|
|000038b0| 73 65 3b 20 0d 09 65 6c | 73 65 20 69 66 20 28 64 |se; ..el|se if (d|
|000038c0| 72 61 66 74 42 69 74 73 | 42 6c 6b 2e 69 45 72 72 |raftBits|Blk.iErr|
|000038d0| 6f 72 20 21 3d 20 6e 6f | 45 72 72 20 7c 7c 20 50 |or != no|Err || P|
|000038e0| 72 45 72 72 6f 72 28 29 | 20 21 3d 20 6e 6f 45 72 |rError()| != noEr|
|000038f0| 72 29 0d 20 20 20 20 20 | 20 20 20 20 20 20 41 6c |r). | Al|
|00003900| 65 72 74 55 73 65 72 20 | 28 29 3b 0d 09 20 0d 7d |ertUser |();.. .}|
|00003910| 20 20 2f 2f 20 65 6e 64 | 20 6f 66 20 64 6f 44 72 | // end| of doDr|
|00003920| 61 66 74 42 69 74 73 0d | 0d 0d 0d 0d 2f 2f 2d 2d |aftBits.|....//--|
|00003930| 2d 2d 2d 2d 20 64 6f 4e | 4f 44 72 61 66 74 42 69 |---- doN|ODraftBi|
|00003940| 74 73 20 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ts -----|--------|
|00003950| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003960| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003970| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003980| 2d 2d 0d 2f 2f 0d 2f 2f | 09 64 6f 4e 4f 44 72 61 |--.//.//|.doNODra|
|00003990| 66 74 42 69 74 73 20 77 | 69 6c 6c 20 75 6e 64 6f |ftBits w|ill undo|
|000039a0| 20 74 68 65 20 63 61 6c | 6c 20 74 6f 20 73 65 74 | the cal|l to set|
|000039b0| 20 74 68 65 20 64 72 61 | 66 74 42 69 74 73 4f 70 | the dra|ftBitsOp|
|000039c0| 20 6f 70 63 6f 64 65 2e | 20 20 54 68 69 73 20 66 | opcode.| This f|
|000039d0| 75 6e 63 74 69 6f 6e 20 | 63 61 6e 0d 2f 2f 20 20 |unction |can.// |
|000039e0| 4e 4f 54 20 62 65 20 63 | 61 6c 6c 65 64 20 69 66 |NOT be c|alled if|
|000039f0| 20 64 6f 44 72 61 66 74 | 42 69 74 73 20 77 61 73 | doDraft|Bits was|
|00003a00| 20 6e 6f 74 20 63 61 6c | 6c 65 64 20 6f 72 20 74 | not cal|led or t|
|00003a10| 68 69 73 20 6f 70 63 6f | 64 65 20 69 73 20 6e 6f |his opco|de is no|
|00003a20| 74 20 73 75 70 70 6f 72 | 74 65 64 20 62 79 20 74 |t suppor|ted by t|
|00003a30| 68 65 20 0d 2f 2f 09 63 | 75 72 72 65 6e 74 20 70 |he .//.c|urrent p|
|00003a40| 72 69 6e 74 65 72 20 64 | 72 69 76 65 72 2e 20 20 |rinter d|river. |
|00003a50| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 62 65 |This fun|ction be|
|00003a60| 68 61 76 65 73 20 69 6e | 20 74 68 65 20 73 61 6d |haves in| the sam|
|00003a70| 65 20 6d 61 6e 6e 65 72 | 20 61 73 20 64 65 73 63 |e manner| as desc|
|00003a80| 72 69 62 65 64 20 61 62 | 6f 76 65 0d 2f 2f 20 20 |ribed ab|ove.// |
|00003a90| 66 6f 72 20 64 6f 44 72 | 61 66 74 42 69 74 73 2e |for doDr|aftBits.|
|00003aa0| 0d 2f 2f 0d 0d 76 6f 69 | 64 20 64 6f 4e 4f 44 72 |.//..voi|d doNODr|
|00003ab0| 61 66 74 42 69 74 73 20 | 28 29 0d 7b 0d 09 54 44 |aftBits |().{..TD|
|00003ac0| 66 74 42 69 74 73 42 6c | 6b 09 09 64 72 61 66 74 |ftBitsBl|k..draft|
|00003ad0| 42 69 74 73 42 6c 6b 3b | 0d 0d 09 64 72 61 66 74 |BitsBlk;|...draft|
|00003ae0| 42 69 74 73 42 6c 6b 2e | 69 4f 70 43 6f 64 65 20 |BitsBlk.|iOpCode |
|00003af0| 3d 20 6e 6f 44 72 61 66 | 74 42 69 74 73 4f 70 3b |= noDraf|tBitsOp;|
|00003b00| 0d 09 64 72 61 66 74 42 | 69 74 73 42 6c 6b 2e 68 |..draftB|itsBlk.h|
|00003b10| 50 72 69 6e 74 20 3d 20 | 67 50 72 52 65 63 48 64 |Print = |gPrRecHd|
|00003b20| 6c 3b 0d 09 50 72 47 65 | 6e 65 72 61 6c 28 28 50 |l;..PrGe|neral((P|
|00003b30| 74 72 29 20 26 64 72 61 | 66 74 42 69 74 73 42 6c |tr) &dra|ftBitsBl|
|00003b40| 6b 29 3b 0d 0d 09 69 66 | 20 28 64 72 61 66 74 42 |k);...if| (draftB|
|00003b50| 69 74 73 42 6c 6b 2e 69 | 45 72 72 6f 72 20 21 3d |itsBlk.i|Error !=|
|00003b60| 20 6e 6f 45 72 72 20 7c | 7c 20 50 72 45 72 72 6f | noErr ||| PrErro|
|00003b70| 72 28 29 20 21 3d 20 6e | 6f 45 72 72 29 0d 20 20 |r() != n|oErr). |
|00003b80| 20 20 20 20 20 41 6c 65 | 72 74 55 73 65 72 20 28 | Ale|rtUser (|
|00003b90| 29 3b 0d 0d 7d 20 20 2f | 2f 20 65 6e 64 20 6f 66 |);..} /|/ end of|
|00003ba0| 20 64 6f 4e 4f 44 72 61 | 66 74 42 69 74 73 0d 0d | doNODra|ftBits..|
|00003bb0| 0d 0d 0d 2f 2f 2d 2d 2d | 2d 2d 2d 20 53 68 6f 77 |...//---|--- Show|
|00003bc0| 4c 61 6e 64 73 63 61 70 | 65 52 65 73 75 6c 74 73 |Landscap|eResults|
|00003bd0| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | -------|--------|
|00003be0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003bf0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003c00| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0d 2f 2f 0d 2f 2f 09 |--------|-.//.//.|
|00003c10| 54 68 69 73 20 72 6f 75 | 74 69 6e 65 20 77 69 6c |This rou|tine wil|
|00003c20| 6c 20 73 68 6f 77 20 74 | 68 65 20 72 65 73 75 6c |l show t|he resul|
|00003c30| 74 73 20 76 69 61 20 61 | 20 64 69 61 6c 6f 67 20 |ts via a| dialog |
|00003c40| 6f 66 20 74 68 65 20 49 | 73 4c 61 6e 64 73 63 61 |of the I|sLandsca|
|00003c50| 70 65 53 65 74 20 66 75 | 6e 63 74 69 6f 6e 2e 0d |peSet fu|nction..|
|00003c60| 2f 2f 0d 0d 76 6f 69 64 | 20 53 68 6f 77 4c 61 6e |//..void| ShowLan|
|00003c70| 64 73 63 61 70 65 52 65 | 73 75 6c 74 73 20 28 42 |dscapeRe|sults (B|
|00003c80| 6f 6f 6c 65 61 6e 20 72 | 65 73 75 6c 74 29 0d 0d |oolean r|esult)..|
|00003c90| 7b 0d 20 20 09 73 68 6f | 72 74 09 09 09 69 74 65 |{. .sho|rt...ite|
|00003ca0| 6d 48 69 74 3b 0d 20 20 | 09 53 74 72 69 6e 67 48 |mHit;. |.StringH|
|00003cb0| 61 6e 64 6c 65 09 64 69 | 73 70 6c 61 79 4d 65 73 |andle.di|splayMes|
|00003cc0| 73 61 67 65 3b 0d 20 20 | 09 53 74 72 32 35 35 09 |sage;. |.Str255.|
|00003cd0| 09 09 64 69 73 70 6c 61 | 79 4d 65 73 73 61 67 65 |..displa|yMessage|
|00003ce0| 53 74 72 69 6e 67 3b 0d | 20 20 0d 20 20 09 53 65 |String;.| . .Se|
|00003cf0| 74 43 75 72 73 6f 72 28 | 26 71 64 2e 61 72 72 6f |tCursor(|&qd.arro|
|00003d00| 77 29 3b 0d 20 20 0d 20 | 20 09 69 66 20 28 72 65 |w);. . | .if (re|
|00003d10| 73 75 6c 74 29 20 20 0d | 20 20 20 20 20 20 64 69 |sult) .| di|
|00003d20| 73 70 6c 61 79 4d 65 73 | 73 61 67 65 20 3d 20 47 |splayMes|sage = G|
|00003d30| 65 74 53 74 72 69 6e 67 | 20 28 32 30 31 29 3b 0d |etString| (201);.|
|00003d40| 20 20 20 20 65 6c 73 65 | 0d 09 20 20 64 69 73 70 | else|.. disp|
|00003d50| 6c 61 79 4d 65 73 73 61 | 67 65 20 3d 20 47 65 74 |layMessa|ge = Get|
|00003d60| 53 74 72 69 6e 67 20 28 | 32 30 32 29 3b 0d 09 0d |String (|202);...|
|00003d70| 09 0d 20 20 20 09 69 66 | 20 28 64 69 73 70 6c 61 |.. .if| (displa|
|00003d80| 79 4d 65 73 73 61 67 65 | 20 21 3d 20 6e 69 6c 29 |yMessage| != nil)|
|00003d90| 0d 09 20 20 42 6c 6f 63 | 6b 4d 6f 76 65 28 2a 64 |.. Bloc|kMove(*d|
|00003da0| 69 73 70 6c 61 79 4d 65 | 73 73 61 67 65 2c 20 26 |isplayMe|ssage, &|
|00003db0| 64 69 73 70 6c 61 79 4d | 65 73 73 61 67 65 53 74 |displayM|essageSt|
|00003dc0| 72 69 6e 67 2c 20 28 6c | 6f 6e 67 29 2a 64 69 73 |ring, (l|ong)*dis|
|00003dd0| 70 6c 61 79 4d 65 73 73 | 61 67 65 5b 30 5d 2b 31 |playMess|age[0]+1|
|00003de0| 4c 29 3b 0d 20 09 65 6c | 73 65 0d 20 20 20 20 20 |L);. .el|se. |
|00003df0| 20 20 41 6c 65 72 74 55 | 73 65 72 28 29 3b 0d 09 | AlertU|ser();..|
|00003e00| 20 20 20 0d 20 20 20 20 | 50 61 72 61 6d 54 65 78 | . |ParamTex|
|00003e10| 74 20 28 64 69 73 70 6c | 61 79 4d 65 73 73 61 67 |t (displ|ayMessag|
|00003e20| 65 53 74 72 69 6e 67 2c | 20 22 5c 70 20 22 2c 20 |eString,| "\p ", |
|00003e30| 22 5c 70 20 22 2c 20 22 | 5c 70 20 22 29 3b 0d 09 |"\p ", "|\p ");..|
|00003e40| 0d 09 69 74 65 6d 48 69 | 74 20 3d 20 4e 6f 74 65 |..itemHi|t = Note|
|00003e50| 41 6c 65 72 74 28 72 4c | 61 6e 64 73 63 61 70 65 |Alert(rL|andscape|
|00003e60| 41 6c 65 72 74 2c 20 6e | 69 6c 29 3b 0d 09 0d 7d |Alert, n|il);...}|
|00003e70| 09 2f 2f 20 20 65 6e 64 | 20 6f 66 20 53 68 6f 77 |.// end| of Show|
|00003e80| 4c 61 6e 64 73 63 61 70 | 65 52 65 73 75 6c 74 73 |Landscap|eResults|
|00003e90| 0d 0d 0d 0d 0d 2f 2f 2d | 2d 2d 2d 2d 2d 20 49 73 |.....//-|----- Is|
|00003ea0| 4c 61 6e 64 73 63 61 70 | 65 53 65 74 20 2d 2d 2d |Landscap|eSet ---|
|00003eb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003ec0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003ed0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003ee0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0d 2f 2f 0d 2f 2f |--------|--.//.//|
|00003ef0| 09 49 73 4c 61 6e 64 73 | 63 61 70 65 53 65 74 20 |.IsLands|capeSet |
|00003f00| 77 69 6c 6c 20 64 65 74 | 65 72 6d 69 6e 65 20 69 |will det|ermine i|
|00003f10| 66 20 74 68 65 20 75 73 | 65 72 20 68 61 73 20 73 |f the us|er has s|
|00003f20| 65 6c 65 63 74 65 64 20 | 6c 61 6e 64 73 63 61 70 |elected |landscap|
|00003f30| 65 20 6f 72 69 65 6e 74 | 61 74 69 6f 6e 20 0d 2f |e orient|ation ./|
|00003f40| 2f 09 66 72 6f 6d 20 74 | 68 65 20 53 74 79 6c 65 |/.from t|he Style|
|00003f50| 20 64 69 61 6c 6f 67 2e | 20 49 66 20 74 68 65 20 | dialog.| If the |
|00003f60| 75 73 65 72 20 68 61 73 | 20 73 65 6c 65 63 74 65 |user has| selecte|
|00003f70| 64 20 6c 61 6e 64 73 63 | 61 70 65 20 6f 72 69 65 |d landsc|ape orie|
|00003f80| 6e 74 61 74 69 6f 6e 2c | 20 77 65 20 77 69 6c 6c |ntation,| we will|
|00003f90| 20 0d 2f 2f 09 72 65 74 | 75 72 6e 20 22 74 72 75 | .//.ret|urn "tru|
|00003fa0| 65 22 20 74 6f 20 74 68 | 65 20 63 61 6c 6c 69 6e |e" to th|e callin|
|00003fb0| 67 20 66 75 6e 63 74 69 | 6f 6e 2e 20 4f 74 68 65 |g functi|on. Othe|
|00003fc0| 72 77 69 73 65 2c 20 72 | 65 74 75 72 6e 20 22 66 |rwise, r|eturn "f|
|00003fd0| 61 6c 73 65 22 2e 0d 2f | 2f 0d 0d 76 6f 69 64 20 |alse"../|/..void |
|00003fe0| 49 73 4c 61 6e 64 73 63 | 61 70 65 53 65 74 20 28 |IsLandsc|apeSet (|
|00003ff0| 54 48 50 72 69 6e 74 20 | 74 68 65 50 72 52 65 63 |THPrint |thePrRec|
|00004000| 48 64 6c 29 0d 0d 7b 0d | 20 20 20 09 54 47 65 74 |Hdl)..{.| .TGet|
|00004010| 52 6f 74 6e 42 6c 6b 09 | 47 65 74 52 6f 74 52 65 |RotnBlk.|GetRotRe|
|00004020| 63 3b 0d 09 0d 20 20 20 | 09 47 65 74 52 6f 74 52 |c;... |.GetRotR|
|00004030| 65 63 2e 69 4f 70 43 6f | 64 65 20 3d 20 67 65 74 |ec.iOpCo|de = get|
|00004040| 52 6f 74 6e 4f 70 3b 0d | 20 20 09 47 65 74 52 6f |RotnOp;.| .GetRo|
|00004050| 74 52 65 63 2e 68 50 72 | 69 6e 74 20 3d 20 74 68 |tRec.hPr|int = th|
|00004060| 65 50 72 52 65 63 48 64 | 6c 3b 0d 20 0d 20 20 09 |ePrRecHd|l;. . .|
|00004070| 50 72 47 65 6e 65 72 61 | 6c 20 28 28 50 74 72 29 |PrGenera|l ((Ptr)|
|00004080| 20 26 47 65 74 52 6f 74 | 52 65 63 29 3b 09 0d 20 | &GetRot|Rec);.. |
|00004090| 09 0d 09 2f 2f 20 20 49 | 66 20 74 68 65 20 6c 61 |...// I|f the la|
|000040a0| 6e 64 73 63 61 70 65 20 | 6f 70 63 6f 64 65 20 69 |ndscape |opcode i|
|000040b0| 73 20 4e 4f 54 20 69 6d | 70 6c 65 6d 65 6e 74 65 |s NOT im|plemente|
|000040c0| 64 20 62 79 20 74 68 65 | 20 63 75 72 72 65 6e 74 |d by the| current|
|000040d0| 20 70 72 69 6e 74 65 72 | 20 64 72 69 76 65 72 2c | printer| driver,|
|000040e0| 0d 09 2f 2f 20 20 73 65 | 74 20 74 68 65 20 66 6c |..// se|t the fl|
|000040f0| 61 67 20 74 6f 20 74 72 | 75 65 2e 20 20 54 68 69 |ag to tr|ue. Thi|
|00004100| 73 20 66 6c 61 67 20 77 | 69 6c 6c 20 70 72 65 65 |s flag w|ill pree|
|00004110| 6e 74 20 74 68 65 20 63 | 61 6c 6c 69 6e 67 20 6f |nt the c|alling o|
|00004120| 66 20 74 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 0d |f this f|unction.|
|00004130| 09 2f 2f 20 20 75 6e 74 | 69 6c 20 74 68 65 20 70 |.// unt|il the p|
|00004140| 72 69 6e 74 65 72 20 64 | 72 69 76 65 72 20 69 73 |rinter d|river is|
|00004150| 20 63 68 61 6e 67 65 64 | 2e 2e 2e 0d 0d 09 69 66 | changed|......if|
|00004160| 20 28 47 65 74 52 6f 74 | 52 65 63 2e 69 45 72 72 | (GetRot|Rec.iErr|
|00004170| 6f 72 20 3d 3d 20 4f 70 | 4e 6f 74 49 6d 70 6c 29 |or == Op|NotImpl)|
|00004180| 0d 09 20 20 67 4c 61 6e | 64 73 63 61 70 65 4f 70 |.. gLan|dscapeOp|
|00004190| 49 6d 70 6c 20 3d 20 66 | 61 6c 73 65 3b 0d 09 20 |Impl = f|alse;.. |
|000041a0| 20 0d 09 20 20 0d 09 2f | 2f 09 57 65 20 6e 6f 77 | .. ../|/.We now|
|000041b0| 20 68 61 76 65 20 74 68 | 65 20 72 65 73 75 6c 74 | have th|e result|
|000041c0| 20 66 72 6f 6d 20 6f 75 | 72 20 63 61 6c 6c 20 74 | from ou|r call t|
|000041d0| 6f 20 50 72 47 65 6e 65 | 72 61 6c 2c 20 62 75 74 |o PrGene|ral, but|
|000041e0| 20 77 65 20 63 68 65 63 | 6b 20 61 6c 6c 0d 09 2f | we chec|k all../|
|000041f0| 2f 09 6b 6e 6f 77 6e 20 | 65 72 72 6f 72 73 20 74 |/.known |errors t|
|00004200| 6f 20 6d 61 6b 65 20 73 | 75 72 65 20 74 68 61 74 |o make s|ure that|
|00004210| 20 50 72 47 65 6e 65 72 | 61 6c 20 77 61 73 20 73 | PrGener|al was s|
|00004220| 75 63 63 65 73 73 66 75 | 6c 20 61 6e 64 20 74 68 |uccessfu|l and th|
|00004230| 65 72 65 0d 09 2f 2f 09 | 68 61 76 65 20 6e 6f 74 |ere..//.|have not|
|00004240| 20 62 65 65 6e 20 61 6e | 79 20 65 72 72 6f 72 73 | been an|y errors|
|00004250| 20 65 6e 63 6f 75 6e 74 | 65 72 65 64 20 66 72 6f | encount|ered fro|
|00004260| 6d 20 70 72 69 6e 74 69 | 6e 67 20 6c 61 6e 64 2e |m printi|ng land.|
|00004270| 0d 0d 09 69 66 20 28 47 | 65 74 52 6f 74 52 65 63 |...if (G|etRotRec|
|00004280| 2e 69 45 72 72 6f 72 20 | 3d 3d 20 6e 6f 45 72 72 |.iError |== noErr|
|00004290| 20 26 26 20 50 72 45 72 | 72 6f 72 28 29 20 3d 3d | && PrEr|ror() ==|
|000042a0| 20 6e 6f 45 72 72 20 26 | 26 20 47 65 74 52 6f 74 | noErr &|& GetRot|
|000042b0| 52 65 63 2e 66 4c 61 6e | 64 73 63 61 70 65 29 0d |Rec.fLan|dscape).|
|000042c0| 09 20 20 20 53 68 6f 77 | 4c 61 6e 64 73 63 61 70 |. Show|Landscap|
|000042d0| 65 52 65 73 75 6c 74 73 | 20 28 74 72 75 65 29 3b |eResults| (true);|
|000042e0| 0d 09 65 6c 73 65 20 69 | 66 20 28 47 65 74 52 6f |..else i|f (GetRo|
|000042f0| 74 52 65 63 2e 69 45 72 | 72 6f 72 20 21 3d 20 4f |tRec.iEr|ror != O|
|00004300| 70 4e 6f 74 49 6d 70 6c | 29 0d 09 20 20 20 20 20 |pNotImpl|).. |
|00004310| 20 20 53 68 6f 77 4c 61 | 6e 64 73 63 61 70 65 52 | ShowLa|ndscapeR|
|00004320| 65 73 75 6c 74 73 20 28 | 66 61 6c 73 65 29 3b 0d |esults (|false);.|
|00004330| 0d 7d 09 2f 2f 20 20 65 | 6e 64 20 6f 66 20 49 73 |.}.// e|nd of Is|
|00004340| 4c 61 6e 64 73 63 61 70 | 65 53 65 74 0d 0d 0d 0d |Landscap|eSet....|
|00004350| 0d 2f 2f 2d 2d 2d 2d 2d | 2d 20 64 72 61 77 53 74 |.//-----|- drawSt|
|00004360| 75 66 66 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |uff ----|--------|
|00004370| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004380| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004390| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000043a0| 2d 2d 2d 2d 2d 2d 0d 2f | 2f 0d 2f 2f 09 64 72 61 |------./|/.//.dra|
|000043b0| 77 53 74 75 66 66 20 77 | 69 6c 6c 20 63 72 65 61 |wStuff w|ill crea|
|000043c0| 74 65 20 74 68 65 20 67 | 72 61 70 68 20 61 6e 64 |te the g|raph and|
|000043d0| 20 64 72 61 77 20 69 74 | 20 64 69 72 65 63 74 6c | draw it| directl|
|000043e0| 79 20 74 6f 20 74 68 65 | 20 63 75 72 72 65 6e 74 |y to the| current|
|000043f0| 20 70 6f 72 74 20 74 68 | 61 74 20 69 73 0d 2f 2f | port th|at is.//|
|00004400| 09 70 61 73 73 65 64 20 | 69 6e 20 76 69 61 20 74 |.passed |in via t|
|00004410| 68 65 20 70 72 50 6f 72 | 74 20 76 61 72 69 61 62 |he prPor|t variab|
|00004420| 6c 65 2e 20 49 74 20 77 | 69 6c 6c 20 64 72 61 77 |le. It w|ill draw|
|00004430| 20 61 6c 6c 20 6f 66 20 | 74 68 65 20 63 6f 6f 72 | all of |the coor|
|00004440| 64 69 6e 61 74 65 73 20 | 61 6e 64 20 66 6f 6e 74 |dinates |and font|
|00004450| 0d 2f 2f 09 73 69 7a 65 | 73 20 61 74 20 74 68 65 |.//.size|s at the|
|00004460| 20 70 72 53 63 61 6c 65 | 20 76 61 6c 75 65 2e 20 | prScale| value. |
|00004470| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 6f 6e | For exa|mple, on|
|00004480| 20 74 68 65 20 49 6d 61 | 67 65 57 72 69 74 65 72 | the Ima|geWriter|
|00004490| 2c 20 74 68 65 20 73 63 | 61 6c 69 6e 67 20 69 73 |, the sc|aling is|
|000044a0| 20 32 58 20 0d 2f 2f 20 | 20 74 68 65 20 73 63 72 | 2X .// | the scr|
|000044b0| 65 65 6e 2e 20 4f 6e 20 | 74 68 65 20 49 6d 61 67 |een. On |the Imag|
|000044c0| 65 57 72 69 74 65 72 20 | 4c 51 2c 20 74 68 72 65 |eWriter |LQ, thre|
|000044d0| 65 20 74 69 6d 65 73 20 | 61 6e 64 20 6f 6e 20 74 |e times |and on t|
|000044e0| 68 65 20 4c 61 73 65 72 | 57 72 69 74 65 72 2c 20 |he Laser|Writer, |
|000044f0| 66 6f 75 72 20 74 69 6d | 65 73 2e 0d 2f 2f 09 54 |four tim|es..//.T|
|00004500| 42 79 20 75 73 69 6e 67 | 20 61 20 73 63 61 6c 65 |By using| a scale|
|00004510| 20 66 61 63 74 6f 72 20 | 65 6e 73 75 72 65 73 20 | factor |ensures |
|00004520| 74 68 61 74 20 79 6f 75 | 20 64 6f 20 4e 4f 54 20 |that you| do NOT |
|00004530| 70 72 69 6e 74 20 22 6d | 69 63 72 6f 22 20 69 6d |print "m|icro" im|
|00004540| 61 67 65 73 20 6f 72 20 | 74 65 78 74 20 77 68 65 |ages or |text whe|
|00004550| 6e 20 0d 2f 2f 09 74 68 | 65 20 53 65 74 52 73 6c |n .//.th|e SetRsl|
|00004560| 20 6f 70 63 6f 64 65 20 | 69 73 20 75 73 65 64 2e | opcode |is used.|
|00004570| 0d 2f 2f 0d 2f 2f 0d 0d | 76 6f 69 64 20 64 72 61 |.//.//..|void dra|
|00004580| 77 53 74 75 66 66 20 28 | 20 70 72 50 6f 72 74 2c |wStuff (| prPort,|
|00004590| 20 70 72 53 63 61 6c 65 | 2c 20 74 6f 50 72 69 6e | prScale|, toPrin|
|000045a0| 74 29 0d 0d 47 72 61 66 | 50 74 72 09 09 70 72 50 |t)..Graf|Ptr..prP|
|000045b0| 6f 72 74 3b 0d 73 68 6f | 72 74 09 09 70 72 53 63 |ort;.sho|rt..prSc|
|000045c0| 61 6c 65 3b 0d 50 69 63 | 48 61 6e 64 6c 65 09 74 |ale;.Pic|Handle.t|
|000045d0| 6f 50 72 69 6e 74 3b 0d | 7b 0d 23 70 72 61 67 6d |oPrint;.|{.#pragm|
|000045e0| 61 20 75 6e 75 73 65 64 | 20 28 70 72 53 63 61 6c |a unused| (prScal|
|000045f0| 65 29 0d 0d 09 52 65 63 | 74 09 09 67 72 61 70 68 |e)...Rec|t..graph|
|00004600| 52 65 63 74 2c 20 70 69 | 63 74 52 65 63 74 3b 0d |Rect, pi|ctRect;.|
|00004610| 0d 0d 09 43 47 72 61 66 | 50 74 72 20 20 20 20 63 |...CGraf|Ptr c|
|00004620| 75 72 72 50 6f 72 74 3b | 0d 09 47 44 48 61 6e 64 |urrPort;|..GDHand|
|00004630| 6c 65 09 63 75 72 72 44 | 65 76 3b 0d 09 0d 0d 09 |le.currD|ev;.....|
|00004640| 47 65 74 47 57 6f 72 6c | 64 20 28 26 63 75 72 72 |GetGWorl|d (&curr|
|00004650| 50 6f 72 74 2c 20 26 63 | 75 72 72 44 65 76 29 3b |Port, &c|urrDev);|
|00004660| 0d 0d 09 53 65 74 47 57 | 6f 72 6c 64 20 28 28 43 |...SetGW|orld ((C|
|00004670| 47 72 61 66 50 74 72 29 | 20 70 72 50 6f 72 74 2c |GrafPtr)| prPort,|
|00004680| 20 63 75 72 72 44 65 76 | 29 3b 0d 0d 09 53 65 74 | currDev|);...Set|
|00004690| 52 65 63 74 20 28 26 67 | 72 61 70 68 52 65 63 74 |Rect (&g|raphRect|
|000046a0| 2c 20 30 2c 20 30 2c 20 | 35 30 30 2c 20 33 30 30 |, 0, 0, |500, 300|
|000046b0| 29 3b 0d 09 0d 09 45 72 | 61 73 65 52 65 63 74 20 |);....Er|aseRect |
|000046c0| 28 26 28 70 72 50 6f 72 | 74 2d 3e 70 6f 72 74 52 |(&(prPor|t->portR|
|000046d0| 65 63 74 29 29 3b 0d 09 | 0d 09 70 69 63 74 52 65 |ect));..|..pictRe|
|000046e0| 63 74 20 3d 20 28 2a 74 | 6f 50 72 69 6e 74 29 2d |ct = (*t|oPrint)-|
|000046f0| 3e 70 69 63 46 72 61 6d | 65 3b 0d 09 0d 09 50 6f |>picFram|e;....Po|
|00004700| 73 69 74 69 6f 6e 52 65 | 63 74 49 6e 52 65 63 74 |sitionRe|ctInRect|
|00004710| 28 70 72 50 6f 72 74 2d | 3e 70 6f 72 74 52 65 63 |(prPort-|>portRec|
|00004720| 74 2c 20 26 70 69 63 74 | 52 65 63 74 2c 20 46 69 |t, &pict|Rect, Fi|
|00004730| 78 52 61 74 69 6f 20 28 | 31 2c 20 32 29 2c 0d 09 |xRatio (|1, 2),..|
|00004740| 09 09 09 09 20 20 20 46 | 69 78 52 61 74 69 6f 20 |.... F|ixRatio |
|00004750| 28 31 2c 20 33 29 29 3b | 0d 0d 09 0d 09 44 72 61 |(1, 3));|.....Dra|
|00004760| 77 50 69 63 74 75 72 65 | 28 74 6f 50 72 69 6e 74 |wPicture|(toPrint|
|00004770| 2c 20 26 70 69 63 74 52 | 65 63 74 29 3b 0d 09 0d |, &pictR|ect);...|
|00004780| 20 20 20 53 65 74 47 57 | 6f 72 6c 64 20 28 63 75 | SetGW|orld (cu|
|00004790| 72 72 50 6f 72 74 2c 20 | 63 75 72 72 44 65 76 29 |rrPort, |currDev)|
|000047a0| 3b 0d 20 0d 7d 20 20 20 | 20 2f 2f 20 65 6e 64 20 |;. .} | // end |
|000047b0| 6f 66 20 64 72 61 77 53 | 74 75 66 66 0d 0d 0d 0d |of drawS|tuff....|
|000047c0| 0d 2f 2f 2d 2d 2d 2d 2d | 2d 20 63 6f 70 79 42 69 |.//-----|- copyBi|
|000047d0| 74 73 4d 79 47 72 61 70 | 68 20 2d 2d 2d 2d 2d 2d |tsMyGrap|h ------|
|000047e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000047f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004800| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004810| 2d 2d 2d 2d 2d 2d 2d 0d | 2f 2f 0d 2f 2f 09 63 6f |-------.|//.//.co|
|00004820| 70 79 42 69 74 73 4d 79 | 47 72 61 70 68 20 77 69 |pyBitsMy|Graph wi|
|00004830| 6c 6c 20 63 72 65 61 74 | 65 20 61 20 6f 66 66 2d |ll creat|e a off-|
|00004840| 73 63 72 65 65 6e 20 77 | 6f 72 6c 64 20 77 69 74 |screen w|orld wit|
|00004850| 68 20 61 20 63 61 6c 6c | 20 74 6f 20 33 32 2d 62 |h a call| to 32-b|
|00004860| 69 74 20 51 75 69 63 6b | 44 72 61 77 27 73 0d 2f |it Quick|Draw's./|
|00004870| 2f 20 20 4e 65 77 47 57 | 6f 72 6c 64 2e 20 20 57 |/ NewGW|orld. W|
|00004880| 65 20 63 68 65 63 6b 20 | 74 6f 20 6d 61 6b 65 20 |e check |to make |
|00004890| 73 75 72 65 20 74 68 61 | 74 20 33 32 2d 62 69 74 |sure tha|t 32-bit|
|000048a0| 20 51 75 69 63 6b 44 72 | 61 77 20 69 73 20 70 72 | QuickDr|aw is pr|
|000048b0| 65 73 65 6e 74 20 42 45 | 46 4f 52 45 20 74 68 69 |esent BE|FORE thi|
|000048c0| 73 20 0d 2f 2f 20 20 66 | 75 6e 63 74 69 6f 6e 20 |s .// f|unction |
|000048d0| 69 73 20 63 61 6c 6c 65 | 64 2e 20 20 57 65 20 77 |is calle|d. We w|
|000048e0| 69 6c 6c 20 74 68 65 6e | 20 64 72 61 77 20 64 69 |ill then| draw di|
|000048f0| 72 65 63 74 6c 79 20 69 | 6e 74 6f 20 74 68 65 20 |rectly i|nto the |
|00004900| 74 68 65 20 6f 66 66 2d | 73 63 72 65 65 6e 20 77 |the off-|screen w|
|00004910| 6f 72 6c 64 20 77 69 74 | 68 20 61 20 63 61 6c 6c |orld wit|h a call|
|00004920| 0d 2f 2f 09 74 6f 20 64 | 72 61 77 53 74 75 66 66 |.//.to d|rawStuff|
|00004930| 2e 20 20 43 6f 70 79 42 | 69 74 73 20 77 69 6c 6c |. CopyB|its will|
|00004940| 20 74 68 65 6e 20 62 65 | 20 75 73 65 64 20 74 6f | then be| used to|
|00004950| 20 63 6f 70 79 20 74 68 | 65 20 63 6f 6e 74 65 6e | copy th|e conten|
|00004960| 74 73 20 6f 66 20 74 68 | 65 20 6f 66 66 2d 73 63 |ts of th|e off-sc|
|00004970| 72 65 65 6e 20 77 6f 72 | 6c 64 0d 2f 2f 09 69 6e |reen wor|ld.//.in|
|00004980| 74 6f 20 74 68 65 20 70 | 72 69 6e 74 65 72 27 73 |to the p|rinter's|
|00004990| 20 47 72 61 66 50 6f 72 | 74 2e 20 20 52 65 6d 65 | GrafPor|t. Reme|
|000049a0| 6d 62 65 72 2c 20 77 68 | 65 6e 20 79 6f 75 20 75 |mber, wh|en you u|
|000049b0| 73 65 20 74 68 65 20 44 | 72 61 66 74 42 69 74 73 |se the D|raftBits|
|000049c0| 20 6f 70 63 6f 64 65 2c | 20 69 74 20 77 69 6c 6c | opcode,| it will|
|000049d0| 20 0d 2f 2f 20 20 6f 6e | 6c 79 20 70 72 69 6e 74 | .// on|ly print|
|000049e0| 20 74 65 78 74 2c 20 62 | 69 74 6d 61 70 73 2c 20 | text, b|itmaps, |
|000049f0| 61 6e 64 20 70 69 78 6d | 61 70 73 2e 20 20 49 66 |and pixm|aps. If|
|00004a00| 20 77 65 20 64 69 64 20 | 4e 4f 54 20 75 73 65 20 | we did |NOT use |
|00004a10| 74 68 65 20 43 6f 70 79 | 42 69 74 73 20 63 61 6c |the Copy|Bits cal|
|00004a20| 6c 2c 20 6f 6e 6c 79 20 | 74 68 65 20 0d 2f 2f 09 |l, only |the .//.|
|00004a30| 68 65 61 64 69 6e 67 20 | 6f 66 20 74 68 65 20 67 |heading |of the g|
|00004a40| 72 61 70 68 20 77 6f 75 | 6c 64 20 62 65 20 70 72 |raph wou|ld be pr|
|00004a50| 69 6e 74 65 64 2e 2e 2e | 0d 2f 2f 0d 0d 76 6f 69 |inted...|.//..voi|
|00004a60| 64 20 63 6f 70 79 42 69 | 74 73 4d 79 47 72 61 70 |d copyBi|tsMyGrap|
|00004a70| 68 20 28 54 50 50 72 50 | 6f 72 74 20 70 72 69 6e |h (TPPrP|ort prin|
|00004a80| 74 50 6f 72 74 2c 20 50 | 69 63 48 61 6e 64 6c 65 |tPort, P|icHandle|
|00004a90| 20 74 6f 50 72 69 6e 74 | 29 0d 7b 0d 09 52 65 63 | toPrint|).{..Rec|
|00004aa0| 74 09 09 67 72 61 70 68 | 52 65 63 74 3b 0d 20 20 |t..graph|Rect;. |
|00004ab0| 20 20 51 44 45 72 72 09 | 09 51 44 45 72 72 6f 72 | QDErr.|.QDError|
|00004ac0| 3b 0d 09 47 44 48 61 6e | 64 6c 65 09 63 75 72 72 |;..GDHan|dle.curr|
|00004ad0| 44 65 76 3b 0d 09 43 47 | 72 61 66 50 74 72 09 63 |Dev;..CG|rafPtr.c|
|00004ae0| 75 72 72 50 6f 72 74 3b | 0d 09 47 57 6f 72 6c 64 |urrPort;|..GWorld|
|00004af0| 50 74 72 09 6d 79 44 72 | 61 77 69 6e 67 50 6f 72 |Ptr.myDr|awingPor|
|00004b00| 74 3b 0d 0d 0d 09 47 65 | 74 47 57 6f 72 6c 64 20 |t;....Ge|tGWorld |
|00004b10| 28 26 63 75 72 72 50 6f | 72 74 2c 20 26 63 75 72 |(&currPo|rt, &cur|
|00004b20| 72 44 65 76 29 3b 0d 09 | 09 0d 09 53 65 74 52 65 |rDev);..|...SetRe|
|00004b30| 63 74 20 28 26 67 72 61 | 70 68 52 65 63 74 2c 20 |ct (&gra|phRect, |
|00004b40| 30 2c 20 30 2c 20 35 30 | 30 20 2a 20 67 53 63 61 |0, 0, 50|0 * gSca|
|00004b50| 6c 65 2c 20 33 30 30 20 | 2a 20 67 53 63 61 6c 65 |le, 300 |* gScale|
|00004b60| 29 3b 0d 09 0d 09 51 44 | 45 72 72 6f 72 20 3d 20 |);....QD|Error = |
|00004b70| 4e 65 77 47 57 6f 72 6c | 64 28 26 6d 79 44 72 61 |NewGWorl|d(&myDra|
|00004b80| 77 69 6e 67 50 6f 72 74 | 2c 20 31 2c 20 26 67 72 |wingPort|, 1, &gr|
|00004b90| 61 70 68 52 65 63 74 2c | 20 6e 69 6c 2c 20 6e 69 |aphRect,| nil, ni|
|00004ba0| 6c 2c 20 30 29 3b 0d 09 | 0d 09 69 66 20 28 51 44 |l, 0);..|..if (QD|
|00004bb0| 45 72 72 6f 72 20 3d 3d | 20 6e 6f 45 72 72 29 0d |Error ==| noErr).|
|00004bc0| 09 20 20 7b 0d 09 20 20 | 20 20 69 66 20 28 21 4c |. {.. | if (!L|
|00004bd0| 6f 63 6b 50 69 78 65 6c | 73 20 28 6d 79 44 72 61 |ockPixel|s (myDra|
|00004be0| 77 69 6e 67 50 6f 72 74 | 2d 3e 70 6f 72 74 50 69 |wingPort|->portPi|
|00004bf0| 78 4d 61 70 29 29 0d 09 | 09 20 20 41 6c 65 72 74 |xMap))..|. Alert|
|00004c00| 55 73 65 72 20 28 29 3b | 0d 09 09 0d 09 09 2f 2f |User ();|......//|
|00004c10| 20 20 44 72 61 77 20 74 | 68 65 20 67 72 61 70 68 | Draw t|he graph|
|00004c20| 20 69 6e 74 6f 20 74 68 | 65 20 6f 66 66 2d 73 63 | into th|e off-sc|
|00004c30| 72 65 65 6e 20 77 6f 72 | 6c 64 2e 2e 2e 0d 09 20 |reen wor|ld..... |
|00004c40| 20 09 64 72 61 77 53 74 | 75 66 66 20 28 6d 79 44 | .drawSt|uff (myD|
|00004c50| 72 61 77 69 6e 67 50 6f | 72 74 2c 20 67 53 63 61 |rawingPo|rt, gSca|
|00004c60| 6c 65 2c 20 74 6f 50 72 | 69 6e 74 29 3b 0d 09 09 |le, toPr|int);...|
|00004c70| 0d 09 09 0d 09 09 2f 2f | 20 20 53 65 74 20 74 68 |......//| Set th|
|00004c80| 65 20 70 6f 72 74 20 74 | 6f 20 74 68 65 20 70 72 |e port t|o the pr|
|00004c90| 69 6e 74 65 72 27 73 20 | 47 72 61 66 50 6f 72 74 |inter's |GrafPort|
|00004ca0| 20 61 6e 64 20 43 6f 70 | 79 42 69 74 73 20 74 68 | and Cop|yBits th|
|00004cb0| 65 20 6f 66 66 2d 73 63 | 72 65 65 6e 0d 09 09 2f |e off-sc|reen.../|
|00004cc0| 2f 20 20 77 6f 72 6c 64 | 20 69 6e 74 6f 20 74 68 |/ world| into th|
|00004cd0| 65 20 70 72 69 6e 74 65 | 72 27 73 20 47 72 61 66 |e printe|r's Graf|
|00004ce0| 50 6f 72 74 2e 0d 09 09 | 0d 09 09 53 65 74 50 6f |Port....|...SetPo|
|00004cf0| 72 74 20 28 26 28 70 72 | 69 6e 74 50 6f 72 74 2d |rt (&(pr|intPort-|
|00004d00| 3e 67 50 6f 72 74 29 29 | 3b 0d 09 20 20 09 43 6f |>gPort))|;.. .Co|
|00004d10| 70 79 42 69 74 73 20 28 | 28 42 69 74 4d 61 70 20 |pyBits (|(BitMap |
|00004d20| 2a 29 20 26 6d 79 44 72 | 61 77 69 6e 67 50 6f 72 |*) &myDr|awingPor|
|00004d30| 74 2d 3e 70 6f 72 74 50 | 69 78 4d 61 70 2c 20 26 |t->portP|ixMap, &|
|00004d40| 28 70 72 69 6e 74 50 6f | 72 74 2d 3e 67 50 6f 72 |(printPo|rt->gPor|
|00004d50| 74 2e 70 6f 72 74 42 69 | 74 73 29 2c 20 0d 09 20 |t.portBi|ts), .. |
|00004d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 26 6d 79 | | &my|
|00004d70| 44 72 61 77 69 6e 67 50 | 6f 72 74 2d 3e 70 6f 72 |DrawingP|ort->por|
|00004d80| 74 52 65 63 74 2c 20 26 | 6d 79 44 72 61 77 69 6e |tRect, &|myDrawin|
|00004d90| 67 50 6f 72 74 2d 3e 70 | 6f 72 74 52 65 63 74 2c |gPort->p|ortRect,|
|00004da0| 20 73 72 63 43 6f 70 79 | 2c 20 6e 69 6c 29 3b 0d | srcCopy|, nil);.|
|00004db0| 09 20 20 20 20 55 6e 6c | 6f 63 6b 50 69 78 65 6c |. Unl|ockPixel|
|00004dc0| 73 20 28 6d 79 44 72 61 | 77 69 6e 67 50 6f 72 74 |s (myDra|wingPort|
|00004dd0| 2d 3e 70 6f 72 74 50 69 | 78 4d 61 70 29 3b 0d 09 |->portPi|xMap);..|
|00004de0| 09 0d 09 20 20 7d 0d 20 | 20 20 20 20 65 6c 73 65 |... }. | else|
|00004df0| 20 41 6c 65 72 74 55 73 | 65 72 20 28 29 3b 0d 09 | AlertUs|er ();..|
|00004e00| 0d 20 20 20 20 69 66 20 | 28 6d 79 44 72 61 77 69 |. if |(myDrawi|
|00004e10| 6e 67 50 6f 72 74 20 21 | 3d 20 6e 69 6c 29 0d 20 |ngPort !|= nil). |
|00004e20| 20 20 09 20 20 44 69 73 | 70 6f 73 65 47 57 6f 72 | . Dis|poseGWor|
|00004e30| 6c 64 20 28 6d 79 44 72 | 61 77 69 6e 67 50 6f 72 |ld (myDr|awingPor|
|00004e40| 74 29 3b 0d 0d 09 53 65 | 74 47 57 6f 72 6c 64 20 |t);...Se|tGWorld |
|00004e50| 28 63 75 72 72 50 6f 72 | 74 2c 20 63 75 72 72 44 |(currPor|t, currD|
|00004e60| 65 76 29 3b 0d 09 0d 7d | 20 20 20 20 2f 2f 20 65 |ev);...}| // e|
|00004e70| 6e 64 20 6f 66 20 63 6f | 70 79 42 69 74 73 4d 79 |nd of co|pyBitsMy|
|00004e80| 47 72 61 70 68 0d 0d 0d | 0d 0d 0d 2f 2f 2d 2d 2d |Graph...|...//---|
|00004e90| 2d 2d 2d 20 63 6f 6d 70 | 61 72 65 50 72 69 6e 74 |--- comp|arePrint|
|00004ea0| 52 65 63 6f 72 64 73 20 | 2d 2d 2d 2d 2d 2d 2d 2d |Records |--------|
|00004eb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004ec0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004ed0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004ee0| 2d 0d 2f 2f 0d 2f 2f 20 | 20 57 65 20 6e 65 65 64 |-.//.// | We need|
|00004ef0| 20 74 6f 20 64 65 74 65 | 72 6d 69 6e 65 20 69 66 | to dete|rmine if|
|00004f00| 20 74 68 65 20 70 72 69 | 6e 74 20 68 61 73 20 63 | the pri|nt has c|
|00004f10| 68 61 6e 67 65 64 2c 20 | 73 69 6e 63 65 20 74 68 |hanged, |since th|
|00004f20| 65 20 6c 61 73 74 20 74 | 69 6d 65 20 77 65 0d 2f |e last t|ime we./|
|00004f30| 2f 20 20 63 61 6c 6c 65 | 64 20 74 68 65 20 50 61 |/ calle|d the Pa|
|00004f40| 67 65 53 65 74 75 70 20 | 6f 72 20 50 72 69 6e 74 |geSetup |or Print|
|00004f50| 20 4a 6f 62 20 64 69 61 | 6c 6f 67 2e 20 20 49 66 | Job dia|log. If|
|00004f60| 20 69 74 20 68 61 73 2c | 20 77 65 20 77 61 6e 74 | it has,| we want|
|00004f70| 20 74 6f 20 75 70 64 61 | 74 65 20 74 68 65 20 70 | to upda|te the p|
|00004f80| 72 69 6e 74 0d 2f 2f 09 | 72 65 63 6f 72 64 20 77 |rint.//.|record w|
|00004f90| 69 74 68 20 74 68 65 20 | 50 72 47 65 6e 65 72 61 |ith the |PrGenera|
|00004fa0| 6c 20 73 65 6c 65 63 74 | 69 6f 6e 73 20 66 72 6f |l select|ions fro|
|00004fb0| 6d 20 74 68 65 20 50 72 | 47 65 6e 65 72 61 6c 20 |m the Pr|General |
|00004fc0| 6d 65 6e 75 2e 20 20 42 | 75 74 2c 20 62 65 66 6f |menu. B|ut, befo|
|00004fd0| 72 65 20 77 65 20 63 61 | 6c 6c 0d 2f 2f 20 20 50 |re we ca|ll.// P|
|00004fe0| 72 47 65 6e 65 72 61 6c | 20 74 6f 20 73 65 74 20 |rGeneral| to set |
|00004ff0| 74 68 65 20 72 65 71 75 | 65 73 74 65 64 20 6f 70 |the requ|ested op|
|00005000| 63 6f 64 65 73 2c 20 77 | 65 20 77 69 6c 6c 20 63 |codes, w|e will c|
|00005010| 61 6c 6c 20 74 65 73 74 | 46 6f 72 50 72 47 65 6e |all test|ForPrGen|
|00005020| 65 72 61 6c 20 74 6f 20 | 6d 61 6b 65 20 73 75 72 |eral to |make sur|
|00005030| 65 0d 2f 2f 20 20 74 68 | 61 74 20 69 74 20 69 73 |e.// th|at it is|
|00005040| 20 73 75 70 70 6f 72 74 | 65 64 20 62 79 20 74 68 | support|ed by th|
|00005050| 65 20 22 6e 65 77 22 20 | 70 72 69 6e 74 65 72 20 |e "new" |printer |
|00005060| 64 72 69 76 65 72 2e 20 | 20 57 65 20 6f 6e 6c 79 |driver. | We only|
|00005070| 20 77 6f 72 72 79 20 61 | 62 6f 75 74 20 74 68 65 | worry a|bout the|
|00005080| 20 53 65 74 52 73 6c 20 | 61 6e 64 0d 2f 2f 20 20 | SetRsl |and.// |
|00005090| 44 72 61 66 74 42 69 74 | 73 20 6f 70 63 6f 64 65 |DraftBit|s opcode|
|000050a0| 73 20 61 74 20 74 68 69 | 73 20 70 6f 69 6e 74 2c |s at thi|s point,|
|000050b0| 20 62 65 63 61 75 73 65 | 20 74 68 65 79 20 65 66 | because| they ef|
|000050c0| 66 65 63 74 20 74 68 65 | 20 61 70 70 65 61 72 61 |fect the| appeara|
|000050d0| 6e 63 65 20 6f 66 20 74 | 68 65 20 50 61 67 65 53 |nce of t|he PageS|
|000050e0| 65 74 75 70 20 0d 2f 2f | 20 20 61 6e 64 20 50 72 |etup .//| and Pr|
|000050f0| 69 6e 74 20 4a 6f 62 2c | 20 69 66 20 50 72 47 65 |int Job,| if PrGe|
|00005100| 6e 65 72 61 6c 20 69 73 | 20 61 76 61 69 6c 61 62 |neral is| availab|
|00005110| 6c 65 2e 0d 2f 2f 0d 0d | 76 6f 69 64 20 63 6f 6d |le..//..|void com|
|00005120| 70 61 72 65 50 72 69 6e | 74 52 65 63 6f 72 64 73 |parePrin|tRecords|
|00005130| 20 28 29 0d 7b 0d 09 54 | 48 50 72 69 6e 74 20 09 | ().{..T|HPrint .|
|00005140| 6c 6f 63 61 6c 50 72 52 | 65 63 48 64 6c 3b 0d 09 |localPrR|ecHdl;..|
|00005150| 73 68 6f 72 74 09 09 6c | 61 74 65 73 74 44 72 69 |short..l|atestDri|
|00005160| 76 65 72 56 65 72 73 3b | 0d 09 0d 0d 09 2f 2f 20 |verVers;|.....// |
|00005170| 43 72 65 61 74 65 20 61 | 20 6e 65 77 20 70 72 69 |Create a| new pri|
|00005180| 6e 74 20 72 65 63 6f 72 | 64 20 77 69 74 68 20 64 |nt recor|d with d|
|00005190| 65 66 61 75 6c 74 20 73 | 65 74 74 69 6e 67 73 0d |efault s|ettings.|
|000051a0| 09 0d 09 6c 6f 63 61 6c | 50 72 52 65 63 48 64 6c |...local|PrRecHdl|
|000051b0| 20 3d 20 28 54 48 50 72 | 69 6e 74 29 20 4e 65 77 | = (THPr|int) New|
|000051c0| 48 61 6e 64 6c 65 28 73 | 69 7a 65 6f 66 28 54 50 |Handle(s|izeof(TP|
|000051d0| 72 69 6e 74 29 29 3b 0d | 09 69 66 20 28 4d 65 6d |rint));.|.if (Mem|
|000051e0| 45 72 72 6f 72 28 29 20 | 3d 3d 20 6e 6f 45 72 72 |Error() |== noErr|
|000051f0| 20 26 26 20 6c 6f 63 61 | 6c 50 72 52 65 63 48 64 | && loca|lPrRecHd|
|00005200| 6c 20 21 3d 20 6e 69 6c | 29 0d 09 7b 0d 09 09 50 |l != nil|)..{...P|
|00005210| 72 69 6e 74 44 65 66 61 | 75 6c 74 20 28 6c 6f 63 |rintDefa|ult (loc|
|00005220| 61 6c 50 72 52 65 63 48 | 64 6c 29 3b 0d 09 0d 09 |alPrRecH|dl);....|
|00005230| 09 6c 61 74 65 73 74 44 | 72 69 76 65 72 56 65 72 |.latestD|riverVer|
|00005240| 73 20 3d 20 50 72 44 72 | 76 72 56 65 72 73 20 28 |s = PrDr|vrVers (|
|00005250| 29 3b 0d 09 0d 09 09 2f | 2f 20 20 54 68 69 73 20 |);...../|/ This |
|00005260| 69 73 20 61 6e 20 65 78 | 61 6d 70 6c 65 20 6f 66 |is an ex|ample of|
|00005270| 20 74 68 65 20 72 69 67 | 68 74 20 70 6c 61 63 65 | the rig|ht place|
|00005280| 20 74 6f 20 75 73 65 20 | 77 44 65 76 2e 20 57 65 | to use |wDev. We|
|00005290| 20 61 72 65 20 6f 6e 6c | 79 20 75 73 69 6e 67 20 | are onl|y using |
|000052a0| 77 44 65 76 20 74 6f 20 | 0d 09 09 2f 2f 20 20 64 |wDev to |...// d|
|000052b0| 65 74 65 72 6d 69 6e 65 | 2c 20 69 66 20 74 68 65 |etermine|, if the|
|000052c0| 20 70 72 69 6e 74 20 72 | 65 63 6f 72 64 73 20 61 | print r|ecords a|
|000052d0| 72 65 20 74 68 65 20 73 | 61 6d 65 20 74 79 70 65 |re the s|ame type|
|000052e0| 2e 20 4e 4f 54 20 74 6f | 20 63 68 65 63 6b 20 66 |. NOT to| check f|
|000052f0| 6f 72 20 73 70 65 63 69 | 66 69 63 0d 09 09 2f 2f |or speci|fic...//|
|00005300| 20 20 66 75 6e 63 74 69 | 6f 6e 61 6c 69 74 79 20 | functi|onality |
|00005310| 77 68 69 63 68 20 77 6f | 75 6c 64 20 62 65 20 61 |which wo|uld be a|
|00005320| 20 62 61 64 20 69 64 65 | 61 20 66 6f 72 20 63 6f | bad ide|a for co|
|00005330| 6d 70 61 74 69 62 69 6c | 69 74 79 20 77 69 74 68 |mpatibil|ity with|
|00005340| 20 75 6e 6b 6e 6f 77 6e | 20 70 72 69 6e 74 65 72 | unknown| printer|
|00005350| 73 2e 0d 09 09 0d 09 09 | 69 66 20 28 50 72 45 72 |s.......|if (PrEr|
|00005360| 72 6f 72 20 28 29 20 3d | 3d 20 6e 6f 45 72 72 29 |ror () =|= noErr)|
|00005370| 0d 09 09 20 7b 0d 09 09 | 20 20 69 66 20 28 28 28 |... {...| if (((|
|00005380| 28 2a 2a 67 50 72 52 65 | 63 48 64 6c 29 2e 70 72 |(**gPrRe|cHdl).pr|
|00005390| 53 74 6c 2e 77 44 65 76 | 29 20 3e 3e 20 38 29 20 |Stl.wDev|) >> 8) |
|000053a0| 21 3d 20 28 28 28 2a 2a | 6c 6f 63 61 6c 50 72 52 |!= (((**|localPrR|
|000053b0| 65 63 48 64 6c 29 2e 70 | 72 53 74 6c 2e 77 44 65 |ecHdl).p|rStl.wDe|
|000053c0| 76 29 20 3e 3e 20 38 29 | 0d 09 09 09 20 20 20 7c |v) >> 8)|.... ||
|000053d0| 7c 20 28 6c 61 74 65 73 | 74 44 72 69 76 65 72 56 || (lates|tDriverV|
|000053e0| 65 72 73 20 21 3d 20 67 | 4f 72 69 67 69 6e 61 6c |ers != g|Original|
|000053f0| 44 72 69 76 65 72 56 65 | 72 73 29 29 0d 09 09 20 |DriverVe|rs))... |
|00005400| 20 20 7b 20 0d 09 09 09 | 20 2f 2f 20 20 53 65 74 | { ....| // Set|
|00005410| 20 74 68 65 20 70 72 69 | 6e 74 20 72 65 63 6f 72 | the pri|nt recor|
|00005420| 64 20 74 6f 20 64 65 66 | 61 75 6c 74 20 73 65 74 |d to def|ault set|
|00005430| 74 69 6e 67 73 20 66 6f | 72 20 74 68 65 20 22 6e |tings fo|r the "n|
|00005440| 65 77 22 20 70 72 69 6e | 74 65 72 2e 2e 2e 0d 09 |ew" prin|ter.....|
|00005450| 0d 09 09 09 20 50 72 69 | 6e 74 44 65 66 61 75 6c |.... Pri|ntDefaul|
|00005460| 74 20 28 67 50 72 52 65 | 63 48 64 6c 29 3b 0d 09 |t (gPrRe|cHdl);..|
|00005470| 09 09 0d 09 09 09 20 2f | 2f 20 20 52 65 73 65 74 |...... /|/ Reset|
|00005480| 20 74 68 65 20 76 61 6c | 75 65 20 6f 66 20 67 4f | the val|ue of gO|
|00005490| 72 69 67 69 6e 61 6c 44 | 72 69 76 65 72 56 65 72 |riginalD|riverVer|
|000054a0| 73 0d 09 0d 09 09 09 20 | 67 4f 72 69 67 69 6e 61 |s...... |gOrigina|
|000054b0| 6c 44 72 69 76 65 72 56 | 65 72 73 20 3d 20 6c 61 |lDriverV|ers = la|
|000054c0| 74 65 73 74 44 72 69 76 | 65 72 56 65 72 73 3b 0d |testDriv|erVers;.|
|000054d0| 09 0d 09 0d 09 09 09 20 | 2f 2f 20 20 52 65 73 65 |....... |// Rese|
|000054e0| 74 20 67 4d 61 78 44 50 | 49 20 74 6f 20 65 6e 61 |t gMaxDP|I to ena|
|000054f0| 62 6c 65 20 74 68 65 20 | 6c 6f 6f 70 20 69 6e 20 |ble the |loop in |
|00005500| 73 65 74 4d 61 78 52 65 | 73 6f 6c 75 74 69 6f 6e |setMaxRe|solution|
|00005510| 20 74 6f 20 66 69 6e 64 | 20 74 68 65 20 63 6f 72 | to find| the cor|
|00005520| 72 65 63 74 20 0d 09 09 | 09 20 2f 2f 20 20 6d 61 |rect ...|. // ma|
|00005530| 78 69 6d 75 6d 20 72 65 | 73 6f 6c 75 74 69 6f 6e |ximum re|solution|
|00005540| 0d 09 0d 09 09 09 20 67 | 4d 61 78 44 50 49 20 3d |...... g|MaxDPI =|
|00005550| 20 30 3b 0d 09 09 09 20 | 0d 09 09 09 20 0d 09 09 | 0;.... |.... ...|
|00005560| 09 20 2f 2f 20 20 52 65 | 73 65 74 20 61 6c 6c 20 |. // Re|set all |
|00005570| 6f 66 20 74 68 65 20 6f | 70 63 6f 64 65 20 69 6d |of the o|pcode im|
|00005580| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 66 6c 61 |plementa|tion fla|
|00005590| 67 73 2e 20 20 57 65 20 | 6e 6f 77 20 68 61 76 65 |gs. We |now have|
|000055a0| 20 61 20 6e 65 77 20 70 | 72 69 6e 74 65 72 0d 09 | a new p|rinter..|
|000055b0| 09 09 20 2f 2f 20 20 64 | 72 69 76 65 72 2c 20 74 |.. // d|river, t|
|000055c0| 68 65 72 65 66 6f 72 65 | 20 77 65 20 6e 65 65 64 |herefore| we need|
|000055d0| 20 74 6f 20 64 65 74 65 | 72 6d 69 6e 65 20 77 68 | to dete|rmine wh|
|000055e0| 69 63 68 20 6f 70 63 6f | 64 65 73 20 61 72 65 20 |ich opco|des are |
|000055f0| 73 75 70 70 6f 72 74 65 | 64 2e 0d 09 09 09 20 0d |supporte|d..... .|
|00005600| 09 09 09 20 67 4c 61 6e | 64 73 63 61 70 65 4f 70 |... gLan|dscapeOp|
|00005610| 49 6d 70 6c 20 3d 20 74 | 72 75 65 3b 0d 09 09 09 |Impl = t|rue;....|
|00005620| 20 67 44 72 61 66 74 42 | 69 74 73 4f 70 49 6d 70 | gDraftB|itsOpImp|
|00005630| 6c 20 3d 20 74 72 75 65 | 3b 0d 09 09 09 20 67 53 |l = true|;.... gS|
|00005640| 65 74 52 73 6c 4f 70 49 | 6d 70 6c 20 3d 20 74 72 |etRslOpI|mpl = tr|
|00005650| 75 65 3b 0d 09 09 09 20 | 0d 09 09 09 20 0d 09 09 |ue;.... |.... ...|
|00005660| 09 20 2f 2f 20 54 65 73 | 74 20 74 6f 20 64 65 74 |. // Tes|t to det|
|00005670| 65 72 6d 69 6e 65 2c 20 | 69 66 20 74 68 65 20 22 |ermine, |if the "|
|00005680| 6e 65 77 22 20 70 72 69 | 6e 74 65 72 20 64 72 69 |new" pri|nter dri|
|00005690| 76 65 72 20 73 75 70 70 | 6f 72 74 73 20 50 72 47 |ver supp|orts PrG|
|000056a0| 65 6e 65 72 61 6c 20 62 | 65 66 6f 72 65 0d 09 09 |eneral b|efore...|
|000056b0| 09 20 2f 2f 20 75 70 64 | 61 74 69 6e 67 20 74 68 |. // upd|ating th|
|000056c0| 65 20 70 72 69 6e 74 20 | 72 65 63 6f 72 64 20 77 |e print |record w|
|000056d0| 69 74 68 20 74 68 65 20 | 72 65 71 75 65 73 74 65 |ith the |requeste|
|000056e0| 64 20 50 72 47 65 6e 65 | 72 61 6c 20 6f 70 63 6f |d PrGene|ral opco|
|000056f0| 64 65 73 2e 2e 2e 0d 09 | 0d 09 09 09 20 69 66 20 |des.....|.... if |
|00005700| 28 50 72 45 72 72 6f 72 | 20 28 29 20 3d 3d 20 6e |(PrError| () == n|
|00005710| 6f 45 72 72 29 0d 09 09 | 09 09 67 50 72 47 65 6e |oErr)...|..gPrGen|
|00005720| 65 72 61 6c 4c 69 76 65 | 73 20 3d 20 74 65 73 74 |eralLive|s = test|
|00005730| 46 6f 72 50 72 47 65 6e | 65 72 61 6c 20 28 29 3b |ForPrGen|eral ();|
|00005740| 0d 09 09 09 20 65 6c 73 | 65 20 41 6c 65 72 74 55 |.... els|e AlertU|
|00005750| 73 65 72 20 28 29 3b 20 | 20 0d 09 0d 09 09 09 20 |ser (); | ...... |
|00005760| 0d 09 09 09 20 2f 2f 20 | 43 61 6c 6c 20 74 68 65 |.... // |Call the|
|00005770| 20 61 70 70 72 6f 70 72 | 69 61 74 65 20 50 72 47 | appropr|iate PrG|
|00005780| 65 6e 65 72 61 6c 20 6f | 70 63 6f 64 65 73 2c 20 |eneral o|pcodes, |
|00005790| 64 65 74 65 72 6d 69 6e | 65 64 20 62 79 20 74 68 |determin|ed by th|
|000057a0| 65 20 50 72 47 65 6e 65 | 72 61 6c 20 6d 65 6e 75 |e PrGene|ral menu|
|000057b0| 2e 2e 2e 0d 09 0d 09 09 | 09 20 69 66 20 28 50 72 |........|. if (Pr|
|000057c0| 45 72 72 6f 72 20 28 29 | 20 3d 3d 20 6e 6f 45 72 |Error ()| == noEr|
|000057d0| 72 20 26 26 20 67 50 72 | 47 65 6e 65 72 61 6c 4c |r && gPr|GeneralL|
|000057e0| 69 76 65 73 29 0d 09 09 | 09 20 20 20 7b 0d 09 09 |ives)...|. {...|
|000057f0| 09 09 69 66 20 28 67 55 | 73 65 44 72 61 66 74 42 |..if (gU|seDraftB|
|00005800| 69 74 73 20 26 26 20 67 | 44 72 61 66 74 42 69 74 |its && g|DraftBit|
|00005810| 73 4f 70 49 6d 70 6c 29 | 20 20 64 6f 44 72 61 66 |sOpImpl)| doDraf|
|00005820| 74 42 69 74 73 28 29 3b | 0d 09 09 09 0d 09 09 09 |tBits();|........|
|00005830| 09 69 66 20 28 67 48 69 | 67 68 52 65 73 6f 6c 75 |.if (gHi|ghResolu|
|00005840| 74 69 6f 6e 4f 4e 20 26 | 26 20 67 53 65 74 52 73 |tionON &|& gSetRs|
|00005850| 6c 4f 70 49 6d 70 6c 29 | 20 20 64 6f 53 65 74 52 |lOpImpl)| doSetR|
|00005860| 73 6c 28 29 3b 20 20 20 | 20 20 0d 09 09 09 20 20 |sl(); | .... |
|00005870| 20 7d 0d 09 09 20 20 20 | 7d 0d 09 09 20 0d 09 09 | }... |}... ...|
|00005880| 20 20 20 69 66 20 28 6c | 6f 63 61 6c 50 72 52 65 | if (l|ocalPrRe|
|00005890| 63 48 64 6c 20 21 3d 20 | 6e 69 6c 29 20 20 44 69 |cHdl != |nil) Di|
|000058a0| 73 70 6f 73 48 61 6e 64 | 6c 65 28 28 48 61 6e 64 |sposHand|le((Hand|
|000058b0| 6c 65 29 20 6c 6f 63 61 | 6c 50 72 52 65 63 48 64 |le) loca|lPrRecHd|
|000058c0| 6c 29 3b 0d 09 09 20 7d | 0d 09 0d 09 09 2f 2f 20 |l);... }|.....// |
|000058d0| 41 6e 20 65 72 72 6f 72 | 20 68 61 73 20 6f 63 63 |An error| has occ|
|000058e0| 75 72 72 65 64 2c 20 63 | 6c 6f 73 65 20 74 68 65 |urred, c|lose the|
|000058f0| 20 50 72 69 6e 74 20 4d | 61 6e 61 67 65 72 20 61 | Print M|anager a|
|00005900| 6e 64 20 61 6c 65 72 74 | 20 74 68 65 20 75 73 65 |nd alert| the use|
|00005910| 72 09 0d 09 09 0d 09 09 | 65 6c 73 65 20 20 20 0d |r.......|else .|
|00005920| 09 09 20 20 7b 0d 09 09 | 20 20 20 50 72 43 6c 6f |.. {...| PrClo|
|00005930| 73 65 20 28 29 3b 0d 09 | 09 20 20 20 69 66 20 28 |se ();..|. if (|
|00005940| 6c 6f 63 61 6c 50 72 52 | 65 63 48 64 6c 20 21 3d |localPrR|ecHdl !=|
|00005950| 20 6e 69 6c 29 20 20 44 | 69 73 70 6f 73 48 61 6e | nil) D|isposHan|
|00005960| 64 6c 65 28 28 48 61 6e | 64 6c 65 29 20 6c 6f 63 |dle((Han|dle) loc|
|00005970| 61 6c 50 72 52 65 63 48 | 64 6c 29 3b 0d 09 09 20 |alPrRecH|dl);... |
|00005980| 20 20 41 6c 65 72 74 55 | 73 65 72 20 28 29 3b 0d | AlertU|ser ();.|
|00005990| 09 09 20 20 7d 0d 09 7d | 0d 09 0d 09 2f 2f 20 41 |.. }..}|....// A|
|000059a0| 6e 20 65 72 72 6f 72 20 | 6f 63 63 75 72 72 65 64 |n error |occurred|
|000059b0| 20 61 6c 6c 6f 63 61 74 | 69 6e 67 20 6e 65 77 20 | allocat|ing new |
|000059c0| 70 72 69 6e 74 20 72 65 | 63 6f 72 64 2c 20 63 6c |print re|cord, cl|
|000059d0| 6f 73 65 20 74 68 65 20 | 50 72 69 6e 74 20 4d 61 |ose the |Print Ma|
|000059e0| 6e 61 67 65 72 20 61 6e | 64 20 61 6c 65 72 74 20 |nager an|d alert |
|000059f0| 74 68 65 20 75 73 65 72 | 0d 09 65 6c 73 65 0d 09 |the user|..else..|
|00005a00| 7b 0d 09 09 50 72 43 6c | 6f 73 65 20 28 29 3b 0d |{...PrCl|ose ();.|
|00005a10| 09 09 41 6c 65 72 74 55 | 73 65 72 28 29 3b 0d 09 |..AlertU|ser();..|
|00005a20| 7d 0d 0d 7d 09 2f 2f 20 | 20 65 6e 64 20 6f 66 20 |}..}.// | end of |
|00005a30| 63 6f 6d 70 61 72 65 50 | 72 69 6e 74 52 65 63 6f |compareP|rintReco|
|00005a40| 72 64 73 0d 0d 0d 0d 0d | 2f 2f 2d 2d 2d 2d 2d 2d |rds.....|//------|
|00005a50| 20 50 72 65 73 65 6e 74 | 53 74 79 6c 65 44 69 61 | Present|StyleDia|
|00005a60| 6c 6f 67 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |log ----|--------|
|00005a70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005a80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005a90| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 2f |--------|------./|
|00005aa0| 2f 0d 2f 2f 20 20 57 65 | 20 77 69 6c 6c 20 70 72 |/.// We| will pr|
|00005ab0| 65 73 65 6e 74 20 74 68 | 65 20 50 61 67 65 53 65 |esent th|e PageSe|
|00005ac0| 74 75 70 20 64 69 61 6c | 6f 67 20 72 65 71 75 65 |tup dial|og reque|
|00005ad0| 73 74 65 64 20 62 79 20 | 74 68 65 20 75 73 65 72 |sted by |the user|
|00005ae0| 2c 20 62 75 74 20 77 65 | 20 77 61 6e 74 20 74 6f |, but we| want to|
|00005af0| 20 6d 61 6b 65 20 73 75 | 72 65 0d 2f 2f 20 20 74 | make su|re.// t|
|00005b00| 68 61 74 20 74 68 65 20 | 70 72 69 6e 74 65 72 20 |hat the |printer |
|00005b10| 64 72 69 76 65 72 20 68 | 61 73 20 6e 6f 74 20 63 |driver h|as not c|
|00005b20| 68 61 6e 67 65 64 2e 20 | 20 57 68 79 3f 20 49 66 |hanged. | Why? If|
|00005b30| 20 74 68 65 20 75 73 65 | 72 20 68 61 73 20 63 68 | the use|r has ch|
|00005b40| 61 6e 67 65 64 20 74 68 | 65 20 70 72 69 6e 74 65 |anged th|e printe|
|00005b50| 72 20 0d 2f 2f 20 20 64 | 72 69 76 65 72 20 76 69 |r .// d|river vi|
|00005b60| 61 20 74 68 65 20 43 68 | 6f 6f 73 65 72 2c 20 77 |a the Ch|ooser, w|
|00005b70| 65 20 77 61 6e 74 20 74 | 6f 20 75 70 64 61 74 65 |e want t|o update|
|00005b80| 20 74 68 65 20 70 72 69 | 6e 74 20 72 65 63 6f 72 | the pri|nt recor|
|00005b90| 64 20 77 69 74 68 20 74 | 68 65 20 72 65 71 75 65 |d with t|he reque|
|00005ba0| 73 74 65 64 0d 2f 2f 20 | 20 50 72 47 65 6e 65 72 |sted.// | PrGener|
|00005bb0| 61 6c 20 6f 70 63 6f 64 | 65 73 2c 20 69 66 20 74 |al opcod|es, if t|
|00005bc0| 68 65 20 22 6e 65 77 22 | 20 28 63 75 72 72 65 6e |he "new"| (curren|
|00005bd0| 74 29 20 70 72 69 6e 74 | 65 72 20 64 72 69 76 65 |t) print|er drive|
|00005be0| 72 20 73 75 70 70 6f 72 | 74 73 20 50 72 47 65 6e |r suppor|ts PrGen|
|00005bf0| 65 72 61 6c 2e 0d 2f 2f | 20 20 52 65 6d 65 6d 62 |eral..//| Rememb|
|00005c00| 65 72 2c 20 74 68 65 20 | 53 65 74 52 73 6c 20 61 |er, the |SetRsl a|
|00005c10| 6e 64 20 44 72 61 66 74 | 42 69 74 73 20 6f 70 63 |nd Draft|Bits opc|
|00005c20| 6f 64 65 73 20 63 68 61 | 6e 67 65 20 74 68 65 20 |odes cha|nge the |
|00005c30| 61 70 70 65 61 72 65 6e | 63 65 20 6f 66 20 74 68 |appearen|ce of th|
|00005c40| 65 20 50 61 67 65 20 53 | 65 74 75 70 20 0d 2f 2f |e Page S|etup .//|
|00005c50| 20 20 64 69 61 6c 6f 67 | 2c 20 74 68 65 72 65 66 | dialog|, theref|
|00005c60| 6f 72 65 20 77 65 20 77 | 61 6e 74 20 74 6f 20 6d |ore we w|ant to m|
|00005c70| 61 6b 65 20 74 68 65 20 | 50 72 47 65 6e 65 72 61 |ake the |PrGenera|
|00005c80| 6c 20 63 61 6c 6c 73 20 | 62 65 66 6f 72 65 20 70 |l calls |before p|
|00005c90| 72 65 73 65 6e 74 69 6e | 67 20 74 68 65 20 64 69 |resentin|g the di|
|00005ca0| 61 6c 6f 67 2e 0d 2f 2f | 0d 0d 76 6f 69 64 20 50 |alog..//|..void P|
|00005cb0| 72 65 73 65 6e 74 53 74 | 79 6c 65 44 69 61 6c 6f |resentSt|yleDialo|
|00005cc0| 67 20 28 29 0d 7b 0d 09 | 69 66 20 28 20 67 50 72 |g ().{..|if ( gPr|
|00005cd0| 52 65 63 48 64 6c 20 29 | 20 0d 09 20 7b 0d 09 09 |RecHdl )| .. {...|
|00005ce0| 50 72 4f 70 65 6e 28 29 | 3b 0d 09 09 0d 09 09 2f |PrOpen()|;....../|
|00005cf0| 2f 20 41 20 70 72 69 6e | 74 20 65 72 72 6f 72 20 |/ A prin|t error |
|00005d00| 6f 63 63 75 72 72 65 64 | 2c 20 63 6c 6f 73 65 20 |occurred|, close |
|00005d10| 75 70 20 74 68 65 20 50 | 72 69 6e 74 20 4d 61 6e |up the P|rint Man|
|00005d20| 61 67 65 72 20 61 6e 64 | 20 6e 6f 74 69 66 79 20 |ager and| notify |
|00005d30| 74 68 65 20 75 73 65 72 | 2e 2e 2e 0d 09 0d 09 09 |the user|........|
|00005d40| 69 66 20 28 50 72 45 72 | 72 6f 72 20 28 29 20 21 |if (PrEr|ror () !|
|00005d50| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 20 20 7b 0d 09 |= noErr)|... {..|
|00005d60| 09 09 50 72 43 6c 6f 73 | 65 28 29 3b 0d 09 09 20 |..PrClos|e();... |
|00005d70| 20 20 20 41 6c 65 72 74 | 55 73 65 72 20 28 29 3b | Alert|User ();|
|00005d80| 0d 09 09 20 20 7d 0d 09 | 09 20 65 6c 73 65 20 0d |... }..|. else .|
|00005d90| 09 09 20 20 20 7b 0d 09 | 09 20 20 20 20 2f 2f 20 |.. {..|. // |
|00005da0| 43 68 65 63 6b 20 74 6f | 20 6d 61 6b 65 20 73 75 |Check to| make su|
|00005db0| 72 65 20 74 68 61 74 20 | 74 68 65 20 75 73 65 72 |re that |the user|
|00005dc0| 20 68 61 73 20 6e 6f 74 | 20 63 68 61 6e 67 65 64 | has not| changed|
|00005dd0| 20 74 68 65 20 70 72 69 | 6e 74 65 72 20 64 72 69 | the pri|nter dri|
|00005de0| 76 65 72 20 0d 09 09 20 | 20 20 0d 09 09 09 63 6f |ver ... | ....co|
|00005df0| 6d 70 61 72 65 50 72 69 | 6e 74 52 65 63 6f 72 64 |mparePri|ntRecord|
|00005e00| 73 20 28 29 3b 20 20 20 | 20 20 20 20 20 0d 0d 09 |s (); | ...|
|00005e10| 09 09 50 72 53 74 6c 44 | 69 61 6c 6f 67 28 67 50 |..PrStlD|ialog(gP|
|00005e20| 72 52 65 63 48 64 6c 29 | 3b 0d 09 09 09 0d 09 09 |rRecHdl)|;.......|
|00005e30| 09 2f 2f 20 43 68 65 63 | 6b 20 66 6f 72 20 6c 61 |.// Chec|k for la|
|00005e40| 6e 64 73 63 61 70 65 20 | 6f 72 69 65 6e 74 61 74 |ndscape |orientat|
|00005e50| 69 6f 6e 2c 20 69 66 20 | 74 68 65 20 75 73 65 72 |ion, if |the user|
|00005e60| 20 68 61 73 20 72 65 71 | 75 65 73 74 65 64 20 74 | has req|uested t|
|00005e70| 68 65 20 74 65 73 74 20 | 76 69 61 0d 09 09 09 2f |he test |via..../|
|00005e80| 2f 20 74 68 65 20 50 72 | 47 65 6e 65 72 61 6c 20 |/ the Pr|General |
|00005e90| 4d 65 6e 75 20 61 6e 64 | 20 50 72 47 65 6e 65 72 |Menu and| PrGener|
|00005ea0| 61 6c 20 65 78 69 73 74 | 73 20 66 6f 72 20 74 68 |al exist|s for th|
|00005eb0| 65 20 63 75 72 72 65 6e | 74 20 70 72 69 6e 74 65 |e curren|t printe|
|00005ec0| 72 20 64 72 69 76 65 72 | 2e 2e 2e 0d 09 09 20 20 |r driver|...... |
|00005ed0| 20 20 0d 09 09 09 69 66 | 20 28 67 43 68 65 63 6b | ....if| (gCheck|
|00005ee0| 46 6f 72 4c 61 6e 64 73 | 63 61 70 65 20 26 26 20 |ForLands|cape && |
|00005ef0| 67 50 72 47 65 6e 65 72 | 61 6c 4c 69 76 65 73 20 |gPrGener|alLives |
|00005f00| 26 26 20 67 4c 61 6e 64 | 73 63 61 70 65 4f 70 49 |&& gLand|scapeOpI|
|00005f10| 6d 70 6c 29 20 20 0d 09 | 09 09 20 20 49 73 4c 61 |mpl) ..|.. IsLa|
|00005f20| 6e 64 73 63 61 70 65 53 | 65 74 20 28 67 50 72 52 |ndscapeS|et (gPrR|
|00005f30| 65 63 48 64 6c 29 3b 0d | 09 09 0d 09 09 20 20 20 |ecHdl);.|..... |
|00005f40| 20 50 72 43 6c 6f 73 65 | 28 29 3b 0d 09 09 20 20 | PrClose|();... |
|00005f50| 20 7d 0d 09 20 7d 0d 09 | 20 65 6c 73 65 20 41 6c | }.. }..| else Al|
|00005f60| 65 72 74 55 73 65 72 20 | 28 29 3b 20 20 20 20 2f |ertUser |(); /|
|00005f70| 2f 20 54 68 65 20 67 50 | 72 52 65 63 48 64 6c 20 |/ The gP|rRecHdl |
|00005f80| 69 73 20 6e 69 6c 20 61 | 6e 64 20 69 74 20 73 68 |is nil a|nd it sh|
|00005f90| 6f 75 6c 64 20 6e 6f 74 | 20 62 65 2c 20 61 6c 65 |ould not| be, ale|
|00005fa0| 72 74 20 74 68 65 20 75 | 73 65 72 0d 0d 7d 09 2f |rt the u|ser..}./|
|00005fb0| 2f 20 20 65 6e 64 20 6f | 66 20 50 72 65 73 65 6e |/ end o|f Presen|
|00005fc0| 74 53 74 79 6c 65 44 69 | 61 6c 6f 67 0d 0d 0d 0d |tStyleDi|alog....|
|00005fd0| 0d 2f 2f 2d 2d 2d 2d 2d | 2d 20 50 72 69 6e 74 54 |.//-----|- PrintT|
|00005fe0| 68 69 73 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |his ----|--------|
|00005ff0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006000| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006010| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006020| 2d 2d 2d 2d 2d 2d 2d 0d | 2f 2f 0d 2f 2f 20 20 50 |-------.|//.// P|
|00006030| 72 69 6e 74 54 68 69 73 | 20 69 73 20 79 6f 75 72 |rintThis| is your|
|00006040| 20 62 61 73 69 63 20 70 | 72 69 6e 74 20 6c 6f 6f | basic p|rint loo|
|00006050| 70 2e 20 20 49 66 20 61 | 6e 79 20 65 72 72 6f 72 |p. If a|ny error|
|00006060| 20 6f 63 63 75 72 73 20 | 64 75 72 69 6e 67 20 74 | occurs |during t|
|00006070| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 0d 2f 2f |his func|tion .//|
|00006080| 20 20 28 69 2e 65 2e 20 | 70 72 69 6e 74 20 74 69 | (i.e. |print ti|
|00006090| 6d 65 29 20 74 68 65 20 | 75 73 65 72 20 77 69 6c |me) the |user wil|
|000060a0| 6c 20 62 65 20 6e 6f 74 | 69 66 69 65 64 20 76 69 |l be not|ified vi|
|000060b0| 61 20 61 20 63 61 6c 6c | 20 74 6f 20 41 6c 65 72 |a a call| to Aler|
|000060c0| 74 55 73 65 72 2e 20 20 | 42 75 74 2c 20 62 65 66 |tUser. |But, bef|
|000060d0| 6f 72 65 20 77 65 20 0d | 2f 2f 20 20 61 6c 65 72 |ore we .|// aler|
|000060e0| 74 20 74 68 65 20 75 73 | 65 72 2c 20 77 65 20 77 |t the us|er, we w|
|000060f0| 69 6c 6c 20 63 61 6c 6c | 20 74 68 65 20 63 6f 72 |ill call| the cor|
|00006100| 72 65 73 70 6f 6e 64 69 | 6e 67 20 63 6c 6f 73 65 |respondi|ng close|
|00006110| 20 63 61 6c 6c 28 73 29 | 20 66 6f 72 20 61 6c 6c | call(s)| for all|
|00006120| 20 6f 66 20 74 68 65 20 | 6f 70 65 6e 20 0d 2f 2f | of the |open .//|
|00006130| 20 20 63 61 6c 6c 28 73 | 29 20 28 69 2e 65 2e 20 | call(s|) (i.e. |
|00006140| 50 72 4f 70 65 6e 44 6f | 63 20 20 2d 2d 3e 20 50 |PrOpenDo|c --> P|
|00006150| 72 43 6c 6f 73 65 44 6f | 63 29 20 61 6e 64 20 63 |rCloseDo|c) and c|
|00006160| 6c 6f 73 65 20 75 70 20 | 74 68 65 20 50 72 69 6e |lose up |the Prin|
|00006170| 74 20 4d 61 6e 61 67 65 | 72 2e 20 20 46 6f 72 20 |t Manage|r. For |
|00006180| 61 20 0d 2f 2f 20 20 63 | 6f 6d 70 6c 65 74 65 20 |a .// c|omplete |
|00006190| 69 6e 64 75 73 74 72 69 | 61 6c 20 73 74 72 65 6e |industri|al stren|
|000061a0| 67 74 68 20 70 72 69 6e | 74 20 6c 6f 6f 70 2c 20 |gth prin|t loop, |
|000061b0| 73 65 65 20 54 65 63 68 | 20 4e 6f 74 65 20 23 31 |see Tech| Note #1|
|000061c0| 36 31 2e 20 20 0d 2f 2f | 0d 0d 76 6f 69 64 20 50 |61. .//|..void P|
|000061d0| 72 69 6e 74 54 68 69 73 | 28 50 69 63 48 61 6e 64 |rintThis|(PicHand|
|000061e0| 6c 65 20 50 49 43 54 54 | 6f 50 72 69 6e 74 29 0d |le PICTT|oPrint).|
|000061f0| 7b 0d 09 73 68 6f 72 74 | 09 09 09 4e 75 6d 62 65 |{..short|...Numbe|
|00006200| 72 4f 66 50 61 67 65 73 | 3b 0d 09 54 50 50 72 50 |rOfPages|;..TPPrP|
|00006210| 6f 72 74 09 09 70 72 69 | 6e 74 50 6f 72 74 3b 0d |ort..pri|ntPort;.|
|00006220| 09 4f 53 45 72 72 09 09 | 09 65 72 72 3b 0d 09 73 |.OSErr..|.err;..s|
|00006230| 68 6f 72 74 09 09 09 69 | 3b 0d 09 54 50 72 53 74 |hort...i|;..TPrSt|
|00006240| 61 74 75 73 20 09 09 53 | 74 61 74 75 73 3b 0d 09 |atus ..S|tatus;..|
|00006250| 47 44 48 61 6e 64 6c 65 | 09 09 63 75 72 72 44 65 |GDHandle|..currDe|
|00006260| 76 3b 0d 09 43 47 72 61 | 66 50 74 72 09 09 63 75 |v;..CGra|fPtr..cu|
|00006270| 72 72 50 6f 72 74 3b 0d | 0d 09 47 65 74 47 57 6f |rrPort;.|..GetGWo|
|00006280| 72 6c 64 20 28 26 63 75 | 72 72 50 6f 72 74 2c 20 |rld (&cu|rrPort, |
|00006290| 26 63 75 72 72 44 65 76 | 29 3b 0d 09 0d 09 69 66 |&currDev|);....if|
|000062a0| 20 28 20 67 50 72 52 65 | 63 48 64 6c 20 29 20 7b | ( gPrRe|cHdl ) {|
|000062b0| 0d 09 09 50 72 4f 70 65 | 6e 28 29 3b 0d 09 09 69 |...PrOpe|n();...i|
|000062c0| 66 20 28 20 50 72 45 72 | 72 6f 72 28 29 20 3d 3d |f ( PrEr|ror() ==|
|000062d0| 20 6e 6f 45 72 72 20 29 | 20 7b 20 0d 09 09 0d 09 | noErr )| { .....|
|000062e0| 09 20 20 2f 2f 20 44 65 | 74 65 72 6d 69 6e 65 20 |. // De|termine |
|000062f0| 69 66 20 74 68 65 20 70 | 72 69 6e 74 65 72 20 64 |if the p|rinter d|
|00006300| 72 69 76 65 72 20 68 61 | 73 20 63 68 61 6e 67 65 |river ha|s change|
|00006310| 64 2e 2e 2e 0d 09 09 20 | 20 0d 09 09 20 20 63 6f |d...... | ... co|
|00006320| 6d 70 61 72 65 50 72 69 | 6e 74 52 65 63 6f 72 64 |mparePri|ntRecord|
|00006330| 73 20 28 29 3b 20 20 20 | 20 20 0d 09 09 09 0d 09 |s (); | ......|
|00006340| 09 20 20 69 66 20 28 20 | 50 72 4a 6f 62 44 69 61 |. if ( |PrJobDia|
|00006350| 6c 6f 67 28 67 50 72 52 | 65 63 48 64 6c 29 29 20 |log(gPrR|ecHdl)) |
|00006360| 0d 09 09 09 0d 09 09 09 | 69 66 20 28 20 50 72 45 |........|if ( PrE|
|00006370| 72 72 6f 72 28 29 20 3d | 3d 20 6e 6f 45 72 72 20 |rror() =|= noErr |
|00006380| 29 20 7b 0d 09 09 09 09 | 09 09 20 20 0d 09 09 09 |) {.....|.. ....|
|00006390| 20 20 4e 75 6d 62 65 72 | 4f 66 50 61 67 65 73 20 | Number|OfPages |
|000063a0| 3d 20 28 2a 2a 67 50 72 | 52 65 63 48 64 6c 29 2e |= (**gPr|RecHdl).|
|000063b0| 70 72 4a 6f 62 2e 69 43 | 6f 70 69 65 73 3b 0d 09 |prJob.iC|opies;..|
|000063c0| 09 09 09 09 09 0d 09 09 | 09 20 20 70 72 69 6e 74 |........|. print|
|000063d0| 50 6f 72 74 20 3d 20 50 | 72 4f 70 65 6e 44 6f 63 |Port = P|rOpenDoc|
|000063e0| 28 67 50 72 52 65 63 48 | 64 6c 2c 6e 69 6c 2c 6e |(gPrRecH|dl,nil,n|
|000063f0| 69 6c 29 3b 0d 09 09 09 | 09 09 09 0d 09 09 09 20 |il);....|....... |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.